Skip to content

Commit 5136730

Browse files
committed
docs: add comment about options
1 parent 1a4b3c7 commit 5136730

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/Sentry.Serilog/SentrySink.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,9 @@ private void InnerEmit(LogEvent logEvent)
165165
level: logEvent.Level.ToBreadcrumbLevel());
166166
}
167167

168+
// Read the options from the Hub, rather than the Sink's Serilog-Options, because 'EnableLogs' is declared in the base 'SentryOptions', rather than the derived 'SentrySerilogOptions'.
169+
// In cases where Sentry's Serilog-Sink is added without a DSN (i.e., without initializing the SDK) and the SDK is initialized differently (e.g., through ASP.NET Core),
170+
// then the 'EnableLogs' option of this Sink's Serilog-Options is default, but the Hub's Sentry-Options have the actual user-defined value configured.
168171
var options = hub.GetSentryOptions();
169172
if (options?.Experimental.EnableLogs is true)
170173
{

0 commit comments

Comments
 (0)