I have an ASP.Net Core (.Net Core 1.1.1) application,
which using built-in logger and Serilog.Extensions.Logging.File
for writing the log to file, it works well on my macOS development environment but CentOS environment.
The appsetting json:
"Logging": {
"IncludeScopes": false,
"PathFormat": "Logs/log-{Date}.log",
"RetainedFileCountLimit": 7,
"LogLevel": {
"Default": "Warning"
}
}
Startup.cs:
public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory) {
loggerFactory
.AddConsole(Configuration.GetSection("Logging"))
.AddFile(Configuration.GetSection("Logging"))
.AddDebug();
The Logs
directory not exists, I have check following:
- application folder owner is
centos
- application services
User
iscentos
, same as folder owner - logs is available on
journalctl
- no error message
Am I missing something?