I am able to log to Windows Event Viewer using Serilog. However, it logs to Windows Logs / Application. I wish to log to Applications and Service Logs. I think I need to create a custom channel and then config the logger to send to that custom channel.
https://learn.microsoft.com/en-us/previous-versions/bb756956(v=msdn.10)?redirectedfrom=MSDN I think this custom channel is an application channel. When I research application channel the results always end up Application Insights. I am not using Azure. Just IIS.
Here is my C# code. Any Suggestions?
Log.Logger = new LoggerConfiguration().MinimumLevel.Debug()
.WriteTo.EventLog("Laserfiche_Document_Finder",
manageEventSource: true).CreateLogger();
builder.Host.UseSerilog();
"Serilog": {
"using": [ "Serilog.Sinks.EventLog" ],
"Minimumlevel": {
"Default": "Information"
},
"WriteTo": [
{
"Name": "EventLog",
"Args": {
"source": "DLF",
"manageEventSource": true
}
}
]