diff --git a/src/Serilog.Extensions.Logging/Extensions/Logging/SerilogLogger.cs b/src/Serilog.Extensions.Logging/Extensions/Logging/SerilogLogger.cs index 89b9f93..007e73d 100644 --- a/src/Serilog.Extensions.Logging/Extensions/Logging/SerilogLogger.cs +++ b/src/Serilog.Extensions.Logging/Extensions/Logging/SerilogLogger.cs @@ -139,7 +139,7 @@ internal static LogEventProperty CreateEventIdProperty(EventId eventId) if (eventId.Id != 0) { - if (eventId.Id < LowEventIdValues.Length) + if (eventId.Id >= 0 && eventId.Id < LowEventIdValues.Length) // Avoid some allocations properties.Add(LowEventIdValues[eventId.Id]); else diff --git a/src/Serilog.Extensions.Logging/Serilog.Extensions.Logging.csproj b/src/Serilog.Extensions.Logging/Serilog.Extensions.Logging.csproj index 479cb20..9a3e564 100644 --- a/src/Serilog.Extensions.Logging/Serilog.Extensions.Logging.csproj +++ b/src/Serilog.Extensions.Logging/Serilog.Extensions.Logging.csproj @@ -2,7 +2,7 @@ Low-level Serilog provider for Microsoft.Extensions.Logging - 3.0.0 + 3.0.1 Microsoft;Serilog Contributors netstandard2.0 true