Closed pantonis closed 1 year ago
@pantonis You should be setting the MinimumLevel
property in Serilog JSON Config as follows
"Serilog": {
// You should add this to set the minimum log level
"MinimumLevel": {
"Default": "Information",
"Override": {
"Microsoft.AspNetCore": "Warning"
}
},
"WriteTo": [
{
"Name": "Console"
}
{
"Name": "Elasticsearch",
"Args": {
"nodeUris": "http://elasticsearch:9200",
"indexFormat": "logs-{0:yyyy.MM}",
"emitEventFailure": "WriteToSelfLog",
"autoRegisterTemplate": true,
"registerTemplateFailure": "IndexAnyway",
"numberOfShards": 2,
"numberOfReplicas": 1
}
}
]
}
@YoussefWaelMohamedLotfy I think the Args you specified are properties of Serilog.Sink.ElasticSearch library not of this library.
Thanks for bringing this to my attention!
Opened https://github.com/elastic/ecs-dotnet/pull/328 to add the ability to give the sink its own dedicated minimum log level.
I m using Serilog to write to a file and also to push to Elastic (using Elastic.Serilog.Sinks 8.6.0) How can I specify in the json file which log level to append to Elastic?
does not seem to work