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
"Logging": {
"LogLevel": {
"Default": "Debug",
"System": "Information",
"Microsoft": "Error"
},
"File": {
"Path": "app.log",
"Append": "True",
"FileSizeLimitBytes": 3, // use to activate rolling file behaviour
"MaxRollingFiles": 4 // use to specify max number of log files
}
}
And registering in my console app
var logFilePath = configuration.GetSection("Logging");
new ServiceCollection()
.AddLogging(loggingBuilder => loggingBuilder.AddFile(logFilePath))
Adding the logger config as per documentation
And registering in my console app
Then injecting to my class
Generates 4 separate files:
app.log
app1.log
app2.log
app3.log
These files are overwritten each time I run the application
Is that as expected? Shouldn't my
"Append": "True"
option cause them to not overwrite previous log files?Also, how does the log level work, and how do I know what log is going to be written to which file?
The docs, while useful in registering the library, don't really explain how to use it properly
Really appreciate any guidance, thanks
The text was updated successfully, but these errors were encountered: