From 151aa23a599c242ca1e3f72f0c1c008564bcd2d6 Mon Sep 17 00:00:00 2001 From: Ivan Tustanivskyi Date: Thu, 19 Nov 2026 19:15:01 +0200 Subject: [PATCH 1/3] docs(unreal): Document trace level and ESentryLogLevel for structured logs --- docs/platforms/unreal/migration/index.mdx | 36 +++++++++++++++++++ .../logs/best-practices/unreal.mdx | 31 ++++++++-------- platform-includes/logs/options/unreal.mdx | 11 +++--- platform-includes/logs/setup/unreal.mdx | 21 ++++++++--- platform-includes/logs/usage/unreal.mdx | 6 +++- 5 files changed, 78 insertions(+), 27 deletions(-) diff --git a/docs/platforms/unreal/migration/index.mdx b/docs/platforms/unreal/migration/index.mdx index e5ab36e7faf14..7afd83ef15fd9 100644 --- a/docs/platforms/unreal/migration/index.mdx +++ b/docs/platforms/unreal/migration/index.mdx @@ -9,6 +9,42 @@ sidebar_section: configuration We recommend using this guide starting from the version closes to your current version which might require scrolling further down before jumping to the latest guide. +## Migrating to 2.0.0 + +### Breaking changes + +#### Structured Logs Level + +Structured logs now use the new `ESentryLogLevel` enum instead of `ESentryLevel`. It adds the `Trace` level, which the logs protocol supports but events, breadcrumbs, and scopes don't. Events, breadcrumbs, and scopes still use `ESentryLevel`. + +If you set or read the level of a `USentryLog` (for example, in a custom `USentryBeforeLogHandler`), update your code to use `ESentryLogLevel`: + +```cpp +// Filtering logs by level before v2.0.0 + +if (LogData->GetLevel() == ESentryLevel::Debug) +{ + return nullptr; +} + +// Filtering logs by level in v2.0.0 + +if (LogData->GetLevel() == ESentryLogLevel::Debug || LogData->GetLevel() == ESentryLogLevel::Trace) +{ + return nullptr; +} +``` + +If you use Blueprints, recreate the **Set Level** and **Get Level** nodes of `Sentry Log` objects and the nodes connected to them. + +#### Unreal Engine Log Forwarding + +`UE_LOG` messages with `VeryVerbose` verbosity are now sent as `trace` structured logs instead of `debug` ones. The `Verbose/VeryVerbose` option in the plugin settings (`StructuredLoggingLevels.bOnDebugLog`) is split into the `Verbose` (`bOnDebugLog`) and `VeryVerbose` (`bOnTraceLog`) options. + +If your project configuration enables `bOnDebugLog` and doesn't set `bOnTraceLog`, the SDK continues to forward `VeryVerbose` messages. To forward only `Verbose` messages, set `bOnTraceLog` to `false`. + +Breadcrumbs for `VeryVerbose` messages still use the `Debug` level. + ## Migrating to 1.0.0 ### Breaking changes diff --git a/platform-includes/logs/best-practices/unreal.mdx b/platform-includes/logs/best-practices/unreal.mdx index 8a5ea58928aba..dcfecee290c02 100644 --- a/platform-includes/logs/best-practices/unreal.mdx +++ b/platform-includes/logs/best-practices/unreal.mdx @@ -6,17 +6,16 @@ This makes debugging dramatically faster — one query returns everything about ```cpp // ❌ Scattered thin logs -SentrySubsystem->AddLog(TEXT("Starting checkout"), ESentryLevel::Info); -SentrySubsystem->AddLog(TEXT("Validating cart"), ESentryLevel::Info); -SentrySubsystem->AddLog(TEXT("Processing payment"), ESentryLevel::Info); -SentrySubsystem->AddLog(TEXT("Checkout complete"), ESentryLevel::Info); +SentrySubsystem->LogInfo(TEXT("Starting checkout")); +SentrySubsystem->LogInfo(TEXT("Validating cart")); +SentrySubsystem->LogInfo(TEXT("Processing payment")); +SentrySubsystem->LogInfo(TEXT("Checkout complete")); // ✅ One wide event with full context // Use categories and descriptive messages -SentrySubsystem->AddLog( +SentrySubsystem->LogInfo( FString::Printf(TEXT("Checkout completed - Order: %s, User: %s, Value: %.2f"), *OrderId, *UserId, CartValue), - ESentryLevel::Info, TEXT("Checkout") ); ``` @@ -34,17 +33,15 @@ Use categories to organize logs and make them easier to search and filter. ```cpp // Use categories for different systems -SentrySubsystem->AddLog( +SentrySubsystem->LogInfo( FString::Printf(TEXT("Purchase completed - User: %s, Tier: %s, Value: %.2f"), *UserId, *UserTier, PurchaseValue), - ESentryLevel::Info, TEXT("IAP") ); -SentrySubsystem->AddLog( +SentrySubsystem->LogInfo( FString::Printf(TEXT("Level loaded - Name: %s, LoadTime: %.2fs"), *LevelName, LoadTime), - ESentryLevel::Info, TEXT("GameFlow") ); ``` @@ -57,13 +54,13 @@ Pick a naming convention and stick with it across your codebase. Inconsistent na ```cpp // ❌ Inconsistent categories -SentrySubsystem->AddLog(TEXT("..."), ESentryLevel::Info, TEXT("player")); -SentrySubsystem->AddLog(TEXT("..."), ESentryLevel::Info, TEXT("Player")); -SentrySubsystem->AddLog(TEXT("..."), ESentryLevel::Info, TEXT("PLAYER")); -SentrySubsystem->AddLog(TEXT("..."), ESentryLevel::Info, TEXT("PlayerSystem")); +SentrySubsystem->LogInfo(TEXT("..."), TEXT("player")); +SentrySubsystem->LogInfo(TEXT("..."), TEXT("Player")); +SentrySubsystem->LogInfo(TEXT("..."), TEXT("PLAYER")); +SentrySubsystem->LogInfo(TEXT("..."), TEXT("PlayerSystem")); // ✅ Consistent PascalCase categories -SentrySubsystem->AddLog(TEXT("Player spawned"), ESentryLevel::Info, TEXT("Player")); -SentrySubsystem->AddLog(TEXT("Player died"), ESentryLevel::Warning, TEXT("Player")); -SentrySubsystem->AddLog(TEXT("Player score updated"), ESentryLevel::Debug, TEXT("Player")); +SentrySubsystem->LogInfo(TEXT("Player spawned"), TEXT("Player")); +SentrySubsystem->LogWarning(TEXT("Player died"), TEXT("Player")); +SentrySubsystem->LogDebug(TEXT("Player score updated"), TEXT("Player")); ``` diff --git a/platform-includes/logs/options/unreal.mdx b/platform-includes/logs/options/unreal.mdx index bf90bbf288f9d..d02fcc4b6bc67 100644 --- a/platform-includes/logs/options/unreal.mdx +++ b/platform-includes/logs/options/unreal.mdx @@ -2,11 +2,12 @@ The following configuration options are available for Sentry Logs in Unreal Engi | Option | Description | Default | |--------|-------------|------------| -| **Enable Debug Logs** | Forward Debug level UE_LOG calls to Sentry | `false` | -| **Enable Info Logs** | Forward Info level UE_LOG calls to Sentry | `false` | -| **Enable Warning Logs** | Forward Warning level UE_LOG calls to Sentry | `false` | -| **Enable Error Logs** | Forward Error level UE_LOG calls to Sentry | `false` | -| **Enable Fatal Logs** | Forward Fatal level UE_LOG calls to Sentry | `false` | +| **VeryVerbose** | Forward VeryVerbose UE_LOG calls to Sentry as Trace level logs | `false` | +| **Verbose** | Forward Verbose UE_LOG calls to Sentry as Debug level logs | `false` | +| **Display/Log** | Forward Display and Log UE_LOG calls to Sentry as Info level logs | `false` | +| **Warning** | Forward Warning UE_LOG calls to Sentry as Warning level logs | `false` | +| **Error** | Forward Error UE_LOG calls to Sentry as Error level logs | `false` | +| **Fatal** | Forward Fatal UE_LOG calls to Sentry as Fatal level logs | `false` | | **Send Logs As Breadcrumbs** | Send UE_LOG calls BOTH as Logs and as Breadcrumbs, instead of just Logs | `false` | | **Log Category Filter** | Array of log categories to include (empty = all categories) | Empty | | **Before Log Callback** | Handler to modify or filter log events before sending | None | diff --git a/platform-includes/logs/setup/unreal.mdx b/platform-includes/logs/setup/unreal.mdx index b9919bff2cb1a..108721a60215c 100644 --- a/platform-includes/logs/setup/unreal.mdx +++ b/platform-includes/logs/setup/unreal.mdx @@ -15,6 +15,7 @@ USentrySubsystem* SentrySubsystem = GEngine->GetEngineSubsystemInitializeWithSettings(FConfigureSettingsNativeDelegate::CreateLambda([=](USentrySettings* Settings) { // Enable specific severity levels for UE_LOG forwarding + Settings->StructuredLoggingLevels.bOnTraceLog = false; Settings->StructuredLoggingLevels.bOnDebugLog = false; Settings->StructuredLoggingLevels.bOnInfoLog = true; Settings->StructuredLoggingLevels.bOnWarningLog = true; @@ -25,6 +26,17 @@ SentrySubsystem->InitializeWithSettings(FConfigureSettingsNativeDelegate::Create })); ``` +The SDK maps `UE_LOG` verbosity to structured log levels as follows: + +| `UE_LOG` verbosity | Setting | Sentry Logs UI Severity | +| --- | --- | --- | +| `Fatal` | `bOnFatalLog` | FATAL | +| `Error` | `bOnErrorLog` | ERROR | +| `Warning` | `bOnWarningLog` | WARN | +| `Display`, `Log` | `bOnInfoLog` | INFO | +| `Verbose` | `bOnDebugLog` | DEBUG | +| `VeryVerbose` | `bOnTraceLog` | TRACE | + #### Log Category Filtering You can filter which log categories are sent to Sentry: @@ -63,8 +75,8 @@ class UCustomLogFilter : public USentryBeforeLogHandler public: virtual USentryLog* HandleBeforeLog_Implementation(USentryLog* LogData) override { - // Filter out all debug logs - if (LogData->GetLevel() == ESentryLevel::Debug) + // Filter out all trace and debug logs + if (LogData->GetLevel() == ESentryLogLevel::Trace || LogData->GetLevel() == ESentryLogLevel::Debug) { return nullptr; // Return null to prevent sending } @@ -93,6 +105,7 @@ SettingsDelegate.BindDynamic(this, &USomeClass::HandleSettingsDelegate); void USomeClass::HandleSettingsDelegate(USentrySettings* Settings) { // Configure individual severity levels + Settings->StructuredLoggingLevels.bOnTraceLog = false; Settings->StructuredLoggingLevels.bOnDebugLog = false; Settings->StructuredLoggingLevels.bOnInfoLog = true; Settings->StructuredLoggingLevels.bOnWarningLog = true; @@ -111,9 +124,9 @@ SentrySubsystem->InitializeWithSettings(SettingsDelegate); The `HandleBeforeLog_Implementation` method receives a `USentryLog` object, and should return the log event if you want it to be sent to Sentry, or `nullptr` if you want to discard it. The `USentryLog` object has the following methods: -- `GetLevel()`: Returns the severity level of the log (`ESentryLevel`) +- `GetLevel()`: Returns the severity level of the log (`ESentryLogLevel`) - `GetBody()`: Returns the formatted log message (`FString`) -- `SetLevel(ESentryLevel Level)`: Sets the Level of the Log Event +- `SetLevel(ESentryLogLevel Level)`: Sets the Level of the Log Event - `SetBody(FString& Body)`: Sets the Body of the Log Event - `SetAttribute(Key, Value)`: Sets a custom attribute on the log - `GetAttribute(Key)`: Gets an attribute value diff --git a/platform-includes/logs/usage/unreal.mdx b/platform-includes/logs/usage/unreal.mdx index 36de40a14a7ca..0391ef303a951 100644 --- a/platform-includes/logs/usage/unreal.mdx +++ b/platform-includes/logs/usage/unreal.mdx @@ -41,6 +41,7 @@ SentrySubsystem->LogWarningWithAttributes( ``` Each log level has a corresponding method with attributes support: +- `LogTraceWithAttributes()` - `LogDebugWithAttributes()` - `LogInfoWithAttributes()` - `LogWarningWithAttributes()` @@ -77,6 +78,7 @@ Sentry Logs supports the following log levels: | Method | Sentry Logs UI Severity | | --- | --- | +| `LogTrace()` | TRACE | | `LogDebug()` | DEBUG | | `LogInfo()` | INFO | | `LogWarning()` | WARN | @@ -85,6 +87,7 @@ Sentry Logs supports the following log levels: ```cpp // Examples of different log levels +SentrySubsystem->LogTrace(TEXT("Inventory update started"), TEXT("Inventory")); SentrySubsystem->LogDebug(TEXT("Player position updated"), TEXT("Player")); SentrySubsystem->LogInfo(TEXT("Level loaded successfully"), TEXT("GameFlow")); SentrySubsystem->LogWarning(TEXT("Low memory warning"), TEXT("Performance")); @@ -100,7 +103,8 @@ When structured logging is enabled with the appropriate severity levels, the SDK // Standard Unreal Engine logging - automatically captured when severity levels are enabled UE_LOG(LogGameFlow, Warning, TEXT("Player health is critically low: %d"), PlayerHealth); UE_LOG(LogAssets, Error, TEXT("Failed to load texture: %s"), *TexturePath); -UE_LOG(LogTemp, Log, TEXT("Debug information")); // Only sent if EnableInfoLogs = true +UE_LOG(LogTemp, Log, TEXT("Debug information")); // Only sent if StructuredLoggingLevels.bOnInfoLog = true +UE_LOG(LogTemp, VeryVerbose, TEXT("Trace information")); // Sent as a trace log if StructuredLoggingLevels.bOnTraceLog = true ``` You can configure whether these logs are sent as: From f4b4ed29ce2bc14e3de81c75352fa116b2e68a38 Mon Sep 17 00:00:00 2001 From: Ivan Tustanivskyi Date: Fri, 20 Nov 2026 08:52:58 +0200 Subject: [PATCH 2/3] docs(unreal): Remove VeryVerbose forwarding fallback from migration guide --- docs/platforms/unreal/migration/index.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/platforms/unreal/migration/index.mdx b/docs/platforms/unreal/migration/index.mdx index 7afd83ef15fd9..aa8f4726501a7 100644 --- a/docs/platforms/unreal/migration/index.mdx +++ b/docs/platforms/unreal/migration/index.mdx @@ -41,7 +41,7 @@ If you use Blueprints, recreate the **Set Level** and **Get Level** nodes of `Se `UE_LOG` messages with `VeryVerbose` verbosity are now sent as `trace` structured logs instead of `debug` ones. The `Verbose/VeryVerbose` option in the plugin settings (`StructuredLoggingLevels.bOnDebugLog`) is split into the `Verbose` (`bOnDebugLog`) and `VeryVerbose` (`bOnTraceLog`) options. -If your project configuration enables `bOnDebugLog` and doesn't set `bOnTraceLog`, the SDK continues to forward `VeryVerbose` messages. To forward only `Verbose` messages, set `bOnTraceLog` to `false`. +The `VeryVerbose` option is disabled by default. If your project forwards `Verbose` messages and you also want to forward `VeryVerbose` messages, enable `bOnTraceLog`. Breadcrumbs for `VeryVerbose` messages still use the `Debug` level. From ffff24f9669e8e8b6fdd1f236f6263aaff0da591 Mon Sep 17 00:00:00 2001 From: Ivan Tustanivskyi Date: Tue, 24 Nov 2026 09:22:45 +0200 Subject: [PATCH 3/3] docs(unreal): Document crash backend selection in migration guide (#20932) ## DESCRIBE YOUR PR The Unreal SDK replaces the `UseNativeBackend` option with a new `CrashBackend` option and makes the native backend the default on Windows, Linux, and Xbox. This is a breaking change in v2.0.0. Adds a "Crash Backend Selection" section to the "Migrating to 2.0.0" part of the migration guide. It describes the `Auto`, `Native`, and `Legacy` values and which backend each one selects per platform, shows how to replace `UseNativeBackend=True` with `CrashBackend=Native` in the project configuration, and explains how to keep the previous backends with `CrashBackend=Legacy`. Stacked on #20915, which adds the "Migrating to 2.0.0" section. Not ready to merge until getsentry/sentry-unreal#1717 is released in Unreal SDK v2.0.0. ## Related Items - getsentry/sentry-unreal#1717 - #20915 ## IS YOUR CHANGE URGENT? Help us prioritize incoming PRs by letting us know when the change needs to go live. Select exactly one option. For deadlines, replace `YYYY-MM-DD` with the due date. You can update this information later by editing the PR description. - [ ] Urgent deadline (GA date, etc.): YYYY-MM-DD - [ ] Other deadline: YYYY-MM-DD - [x] No deadline: Not urgent, can wait up to 1 week+ ## SLA - Teamwork makes the dream work, so please add a reviewer to your PRs. - Please give the docs team up to 1 week to review your PR unless you've supplied a deadline. Thanks in advance for your help! ## PRE-MERGE CHECKLIST _Make sure you've checked the following before merging your changes:_ - [ ] Checked Vercel preview for correctness, including links - [ ] PR was reviewed and approved by any necessary SMEs (subject matter experts) - [ ] PR was reviewed and approved by a member of the [Sentry docs team](https://github.com/orgs/getsentry/teams/docs) --- docs/platforms/unreal/migration/index.mdx | 28 +++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/docs/platforms/unreal/migration/index.mdx b/docs/platforms/unreal/migration/index.mdx index aa8f4726501a7..7dc35ed92cc4e 100644 --- a/docs/platforms/unreal/migration/index.mdx +++ b/docs/platforms/unreal/migration/index.mdx @@ -45,6 +45,34 @@ The `VeryVerbose` option is disabled by default. If your project forwards `Verbo Breadcrumbs for `VeryVerbose` messages still use the `Debug` level. +#### Crash Backend Selection + +The `UseNativeBackend` option is replaced by the `CrashBackend` option (**Project Settings > Plugins > Sentry > Crash Handling > Crash backend**), and the native backend is now the default on Windows, Linux, and Xbox. `CrashBackend` accepts the following values: + +| Platform | `Auto` (default) | `Native` | `Legacy` | +| -------------- | ---------------- | -------- | ----------------------------- | +| Windows, Linux | Native | Native | Crashpad | +| Xbox | Native | Native | Breakpad | +| macOS | sentry-cocoa | Native | sentry-cocoa (same as `Auto`) | + +The SDK no longer reads `UseNativeBackend`. If your project configuration file sets it, replace it with `CrashBackend`: + +```ini +; Enabling the native backend before v2.0.0 + +[/Script/Sentry.SentrySettings] +UseNativeBackend=True + +; Enabling the native backend in v2.0.0 (also on macOS) + +[/Script/Sentry.SentrySettings] +CrashBackend=Native +``` + +If you want to keep using Crashpad on Windows and Linux or Breakpad on Xbox, set `CrashBackend=Legacy`. + +The backend is selected at build time, so rebuild your project after changing this option. + ## Migrating to 1.0.0 ### Breaking changes