serilog-sinks-eventlog
serilog-sinks-eventlog copied to clipboard
Eventviwer sink does not work with appsettings.json
Used following content in my appsetting.json , and no log can be found from the eventviwer. In the meanwhile, tried c# api to configure it, and it worked.
{
"Serilog": {
"Using": [ "Serilog.Sinks.EventLog"],
"MinimumLevel": "Debug",
"WriteTo": [
{"Name": "EventLog","Args": { "manageEventSource": true }}
],
"Enrich": [ "FromLogContext", "WithMachineName", "WithThreadId", "WithApplicationName", "WithProcessId" ],
"Properties": {
"Application": "Sample App"
}
}
}
Your WriteTo:Name
property is invalid
It should be
"Serilog": {
"Using": [ "Serilog.Sinks.EventLog" ],
"MinimumLevel": {
"Default": "Debug"
},
"WriteTo": [
{
"Name": "EventLog",
"Args": {
"source": "Source",
"logName": "Log Name"
}
}
]
}