Skip to content

Commit 7bdddec

Browse files
committed
Roll back EventId comparison change; the overridden != operator does not compare names
1 parent ccae6ff commit 7bdddec

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Serilog.Extensions.Logging/Extensions/Logging/SerilogLogger.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,8 @@ LogEvent PrepareWrite<TState>(LogEventLevel level, EventId eventId, TState state
157157
}
158158
}
159159

160-
if (eventId != default)
160+
// The overridden `!=` operator on this type ignores `Name`.
161+
if (eventId.Id != 0 || eventId.Name != null)
161162
properties["EventId"] = CreateEventIdPropertyValue(eventId);
162163

163164
var (traceId, spanId) = Activity.Current is { } activity ?

0 commit comments

Comments
 (0)