I am using SeriLog in my .Net6 application.
I am trying to create a serilog json configuration that will help me create a new log folder each day. Then the logs for that day will be created in the corresponding folder
Eg:
- 20221205/Log_20221205_152358.log
- 20221206/Log_20221206_051633.log
- 20221207/Log_20221207_084812.log
My Current config is as below
"Serilog": {
"MinimumLevel": "Debug",
"WriteTo": [
{
"Name": "File",
"Args": {
"path": "Logs\\log.log",
"rollingInterval": "Minute",
"fileSizeLimitBytes": 1000000,
"rollOnFileSizeLimit": true,
"retainedFileCountLimit": 30,
"outputTemplate": "{Timestamp:yyyy-MM-dd HH:mm:ss.fff} [{Level:t4}] {Message:j}{NewLine}"
}
}
],
"Enrich": [ "FromLogContext", "WithMachineName", "WithExceptionDetails" ],
"Properties": {
"ApplicationName": "SampleApp",
"Environment": "Int"
}
}
}
By using the current configuration, I am not able to create folders with dates. Kindly help me to resolve the issue