You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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?
![WindowsEventViewer](https://user-images.githubusercontent.com/91921107/211178482-933d76c8-ba5b-469d-ad02-a813e5208948.png)
![WritingToWindowsEventViewer](https://user-images.githubusercontent.com/91921107/211178483-e91ff50a-91d4-42a1-9e14-435674fa891d.png)
The text was updated successfully, but these errors were encountered:
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:
The text was updated successfully, but these errors were encountered: