I'm having problems to enable logging when running ASP.NET Core application on Linux. I'm using Serilog.Sinks.File (but also tried with RollingFile) with following configuration defined in appsettings:
"Serilog": {
"Using": [ "Serilog.Sinks.File" ],
"MinimumLevel": {
"Default": "Debug",
"Override": {
"Microsoft": "Warning",
"System": "Warning"
}
},
"WriteTo": [
{
"Name": "File",
"Args": { "path": "core_log.log", "rollingInterval": "Day" }
}
],
"Enrich": [ "FromLogContext", "WithMachineName", "WithThreadId" ],
"Properties": {
"Application": "CORE service"
} }
I also tried with with RollingFile sink using pathFormat but without success. What ever I try, application is not creating the log file.
I also tried multiple variants of path like: /var/test/app/core_log.log or just simply core_log.log but I'm not seeing file anywhere. I tried searching it using:
sudo find / -name '*.log' -print | grep core_log
It is important to mention that when running the same app on the Windows, everything works well and I can see log file created.
Did somebody have similar problem with Serilog on Linux? Can it be something related with privileges?