Serilog configuration with .json file (framework 4.5+)
Install-Package Serilog.Settings.Json
new LoggerConfiguration()
.ReadFrom.Json("SerilogSettings.json")
.CreateLogger();
{
"Serilog": {
"Using": [
"Serilog.Sinks.Console",
"Serilog.Sinks.File"
],
"MinimumLevel": "Debug",
"WriteTo": [
{ "Name": "Console" },
{ "Name": "File", "Args": { "path": "log.txt" } }
],
//Enrich : []
//Filter: []
//AuditTo: []
//Destructure: []
//Properties : {}
}
}