You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Am unable to enable the JsonFormatter with RollingFile from a configuration file. Any insight would be appreciated, presumably I'm missing something obvious
Have tried to delete all Serilog.* packages from my .nuget folder and refresh. Have tried both older/newer version of the serilog and configuration packages. Made no difference though.
Am unable to enable the JsonFormatter with RollingFile from a configuration file. Any insight would be appreciated, presumably I'm missing something obvious
Have updated all package versions, made sure to using "formatter" as the type parameter, and carefully pasted the typename per the only documentation I could find:
http://stackoverflow.com/questions/40880261/configuring-serilog-rollingfile-with-appsettings-json
#31
Have tried to delete all Serilog.* packages from my .nuget folder and refresh. Have tried both older/newer version of the serilog and configuration packages. Made no difference though.
project.json:
"Serilog": "2.3.0",
"Serilog.Extensions.Logging": "1.4.0",
"Serilog.Enrichers.Environment": "2.0.0",
"Serilog.Enrichers.Process": "2.0.0",
"Serilog.Enrichers.Thread": "2.0.0",
"Serilog.Sinks.RollingFile": "2.0.0",
"Serilog.Sinks.Seq": "2.0.0",
"Serilog.Sinks.ColoredConsole": "2.0.0",
"Serilog.Settings.Configuration": "2.2.0"
config.json:
"Serilog": {
"Using": [ "Serilog.Sinks.RollingFile" ],
"MinimumLevel": "Debug",
"WriteTo": [
{
"Name": "RollingFile",
"Args": {
"pathFormat": "c:\logs\application\log-{Date}.json",
"formatter": "Serilog.Formatting.Json.JsonFormatter, Serilog",
"retainedFileCountLimit": "7"
}
}
],
"Enrich": [ "WithMachineName", "WithThreadId", "WithProcessId" ]
}
Unexpectedly this generates log files in plain text (altho in the expected location!). The JsonFormatter configuration is silently ignored:
2017-03-14 15:18:51.192 +01:00 [Debug] Hosting starting
2017-03-14 15:18:51.394 +01:00 [Debug] Hosting started
2017-03-14 15:18:51.627 +01:00 [Information] Request starting HTTP/1.1 GET http://localhost:49652/
etc
The app targets the full .NET framework 4.5.1
The text was updated successfully, but these errors were encountered: