serilog-sinks-eventlog
serilog-sinks-eventlog copied to clipboard
Log Levels are not logged correctly
When writing to the Event Viewer, the log levels Debug and Verbose are logged as Information, and Fatal is logged as Error.
In the file:
https://github.com/serilog/serilog-sinks-eventlog/blob/dev/src/Serilog.Sinks.EventLog/Sinks/EventLog/EventLogSink.cs
Is see the mapping:
static EventLogEntryType LevelToEventLogEntryType(LogEventLevel logEventLevel)
{
switch (logEventLevel)
{
case LogEventLevel.Debug:
case LogEventLevel.Information:
case LogEventLevel.Verbose:
return EventLogEntryType.Information;
case LogEventLevel.Error:
case LogEventLevel.Fatal:
return EventLogEntryType.Error;
case LogEventLevel.Warning:
return EventLogEntryType.Warning;
default:
SelfLog.WriteLine("Unexpected logging level {0}, writing to the event log as `Information`", logEventLevel);
return EventLogEntryType.Information;
}
}
Since the [EventLogEntryType](https://learn.microsoft.com/en-us/dotnet/api/system.diagnostics.eventlogentrytype?view=windowsdesktop-7.0) Enumeration does not contain Debug, Trace, or Fatal, can those Log Levels be written into Categories instead?

