serilog-sinks-eventlog icon indicating copy to clipboard operation
serilog-sinks-eventlog copied to clipboard

Serilog Event Log don't work if source & logname are different

Open harsh288 opened this issue 3 years ago • 0 comments

Hi,

I'm using Serilog and using windows event log sink if I keep logName and Source the same then it works[shown in below snapshot] and if I keep it different it doesn't work, I don't see any logs coming under Serilog, can someone help.

Log.Logger = new LoggerConfiguration()
                  .MinimumLevel.Information()
                  .MinimumLevel.Override("Microsoft", LogEventLevel.Warning)
                  .Enrich.FromLogContext()
                  .WriteTo.EventLog("MyService", "Serilog")    // Here different logName and Source
                  .CreateLogger();
Log.Information("Hello, Windows Event Log!");

image

harsh288 avatar Jul 22 '21 15:07 harsh288