Message Log
The Message Log is a way to display logs to the user in editor and in the output log at the same time. The messages display in the Message Log can react to user interaction by integrating Links to...
The Message Log is a way to display logs to the user in editor and in the output log at the same time. The messages display in the Message Log can react to user interaction by integrating Links to Objects, Blueprints, Assets and more. These messages are displayed in the "Message Log" window available at Window -> Developer Tool -> Message Log and are organized into multiple categories. It's mostly useful as a way to provide artists and Level designer with quick feedback on level or asset configurations.
For ''Output Log'' logging with ''UE_LOG'', see Logging
This article explains how to use the Message Log system in order to display messages to the user in the editor.
Terms and Structure
The Message Log system relies mainly on the FMessageLog
class and the FMessageLogModule
module.
A message is an instance of a FTokenizedMessage
created and added in a Message Log category. The target category is defined by the FMessageLog
instance used to create each message.
/**
* The string literal "PIE" is the FName of the
* message log category to put the message into
*/
FMessageLog PieLog("PIE")
Messages could be included in a Page. After the declaration of a page, each following message is included in it. Most of the time, creating a new page means the old messages become invisible.
These messages and pages are displayed in the Message Log window in Log Listings. Each listing is associated with a log category and is declared with the FMessageLogModule
module. Listings can be configured with the following properties through the FMessageLogInitializationOptions
struct
FMessageLogInitializationOptions()
: bShowFilters(false)
, bShowPages(false)
, bAllowClear(true)
, bDiscardDuplicates(false)
, MaxPageCount(20)
, bShowInLogWindow(true)
, bScrollToBottom(false)
{}
Logging with Message Log
In this section, you will discover how to use the Message Log in your code to display rich messages in the editor's Message Log window.
To keep this section focused on logging, we will make use of FText::FromString()
but you must use LOCTEXT()
in a production project.
Simple logging
All messages must be created from an instance of FMessageLog
. This instance is created by giving the contructor a single FName
containing the log category where you want to send your log message.
// You need the following include at the beginning of the file
// Logging/MessageLog.h contains the declaration of FMessageLog
#include "Logging/MessageLog.h"
//...
// All messages created with this instance will be flushed to the "Play in Editor" log category listing in the Message Log window
FMessageLog PIELogger("PIE");
See "Editor Log Categories" for a full list of the available log categories or "Log Listing creation" to create your own listing
Message Severity
Now, you can send your messages to this category using the Info()
, Warning()
, PerformanceWarning()
, or Error()
methods, depending on the severity of the message. All these methods only take a single FText
parameter that contains the content of the message to display.
CriticalError()
is deprecated as of Unreal Engine 5.1
namespace EMessageSeverity
{
/** Ordered according to their severity */
enum Type : int
{
CriticalError UE_DEPRECATED(5.1, "CriticalError was removed because it can't trigger an assert at the callsite. Use 'checkf' instead.") = 0,
Error = 1,
PerformanceWarning = 2,
Warning = 3,
Info = 4, // Should be last
};
}
PIELogger.Info(FText::FromString("Informationnal message"));
PIELogger.Warning(FText::FromString("Warning message"));
PIELogger.PerformanceWarning(FText::FromString("Warning message about performace issue"));
PIELogger.Error(FText::FromString("Error message"));
You can also use the Message()
method and specify the severity of it with the EMessageSeverity::Type
enum.
PIELogger.Message(EMessageSeverity::Type::Warning, FText::FromString("Enum defined Warning message"));
Messages are stored inside the FMessageLog
but not flushed to the Message Log system before the instance destruction. You must destroy the instance to send all messages declared with it. It isn't recomanded to keep an instance of FMessageLog
too long, keep it simple, just create a new instance in the current scope when you need to log something and let it be destroyed at the end of the scope.
Rich Logging
You can do much more richer logging with Tokenized Messages
Log Listing creation
This section assumes that you know what a Game Module is and already have one configured with a module class.
You can create your own log listing in your Game Module. For the next sections, we assume that your module is called MyModule
1. Import MessageLog module
In your MyModule.Build.cs
file (in the root directory of your module), you can add the MessageLog
module in the PrivateIncludePathModuleNames
list :
// MyModule.Build.cs
namespace UnrealBuildTool.Rules
{
public class MyModule : ModuleRules
{
public MyModule(ReadOnlyTargetRules Target) : base(Target)
{
// ...
PrivateIncludePathModuleNames.AddRange(
new string[]
{
// ...
"MessageLog",
}
);
}
}
}
2. Save your Log Listing
In the class of the module definition, add these required dependencies:
// MyModule.cpp
// (it should be located in your Private directory)
#include "MessageLogInitializationOptions.h"
#include "MessageLogModule.h"
Then use the MessageLogModule
to create your Log Listing
// still in MyModule.cpp
// ...
void FMyModule::StartupModule()
{
// ...
// create a message log to use in my module
FMessageLogModule& MessageLogModule = FModuleManager::LoadModuleChecked<FMessageLogModule>("MessageLog");
FMessageLogInitializationOptions InitOptions;
InitOptions.bShowPages = true;
InitOptions.bAllowClear = true;
InitOptions.bShowFilters = true;
MessageLogModule.RegisterLogListing("MyModule", NSLOCTEXT("MyModule", "MyModuleLogLabel", "My Module"), InitOptions);
}
And don't forget to unregister the message log when the module is shutdown:
void FMyModule::ShutdownModule()
{
// ...
if (FModuleManager::Get().IsModuleLoaded("MessageLog"))
{
// unregister message log
FMessageLogModule& MessageLogModule = FModuleManager::GetModuleChecked<FMessageLogModule>("MessageLog");
MessageLogModule.UnregisterLogListing("MyModule");
}
}
3. Use it
And there you go! You can use it everywhere in your module now:
FMessageLog(FName("MyModule")).Error(LOCTEXT("InvalidValue", "This is not a good value!"));
4. See it
Editor Log Categories
Below is an alphabetized list of all Unreal Engine defined log categories and their associated listings in the editor window. Remember that since these may be generated at compile-time or at module startup, some categories may not be visible until their module / plugin is turn on, or until the conditions are met for the category to be created.
Log Category |
Log Listing Label | Notes |
---|---|---|
AnimBlueprintLog |
Anim Blueprint Log | |
AnimNextCompilerResults |
AnimNext Compiler Results | |
AnimToTextureLog |
AnimToTexture Log | |
AssetCheck |
Asset Check | |
AssetReimport |
Asset Reimport | |
AssetTools |
Asset Tools | |
AutomationTestingLog |
Automation Testing Log | |
BlueprintCompiler or [Blueprint GUID]_[Blueprint Name]_CompilerResultsLog |
BlueprintCompiler | (A new category can be created for each blueprint compilation, Not shown in the Message Log window) |
BlueprintLog |
Blueprint Log | |
BuildAndSubmitErrors |
Build and Submit Errors | |
CompilerResultsLog |
Compiler Log | (A new page is created before each compilation) |
Concert |
Multi-User | |
ControlRigLog |
Control Rig Log | |
ControlRigPythonLog |
Control Rig Python Log | (Reflects the python commands equivalent to user actions with Control Rig. Helps with automation) |
EditorErrors |
Editor Errors | |
HLODResults |
HLOD Results | |
IKRetarget_[UniqueID] |
IK Retarget Log | (A new log is created for each retarget) |
LightingResults |
Lighting Results | (A new page is created before and after each new lightning build) |
Live Link |
LiveLink | |
LoadErrors |
Load Errors | |
LoadingInsights |
Loading Insights | |
LocalizationService |
Localization Service | |
MapCheck |
Map Check | |
MassEntity |
Mass Entity | |
Model View Viewmodel |
Model View Viewmodel | |
MoviePipelinePIEExecutor |
High Quality Media Export | |
Mutable |
Mutable | |
NetworkingInsights |
Networking Insights | |
PackagingResults |
Packaging Results | |
PackedLevelActor |
Packed Level Actor Log | |
PIE |
Play In Editor | (A new page is created before each Play in Editor session) |
RigLogicLog |
RigLogic Log | |
SourceControl |
Source Control | |
SlateStyleLog |
Slate Style Log | |
StallLog |
Editor Stall Logger | |
StateTreeCompiler |
StateTreeCompiler | |
LogStereoPanorama |
Panoramic Capture Log | |
StormSyncDrives |
Storm Sync Drives | |
StormSyncImport |
Storm Sync Editor | |
StormSyncNotifications |
Storm Sync Notifications | |
TimingInsights |
Timing Insights | |
TraceAnalysis |
Trace Analysis | |
TranslationEditor |
Translation Editor | |
UnrealInsights |
Unreal Insights | |
UDNParser |
UDN Parse Errors | (Not shown in the Message Log window) |
USD |
USD | |
LogVirtualization |
Asset Virtualization | |
WidgetEvents |
Widget Event Log | |
WidgetPreviewLog |
Widget Preview Log |
This table was created based on a search of .RegisterLogListing(
in the editor's source code. Last update March 30th, 2025.