I am having an issue formatting the date in the filename using the appsettings.json file for a C# worker service.
My current config looks like this:
Serilog": {
"WriteTo": [
{
"Name": "File",
"Args": {
"path": "C:\\Program Files (x86)\\Alarm\\AlarmServiceLogs\\AlarmService.txt",
"rollingInterval": "Day"
}
}
]
}
It's very basic. I tried adding {Date: yyyy-DD-MM} and other variations as well as using pathFormat rather than path, but that all just seems to add the verbatum text to the log file name.
Is this doable from the .json file? Otherwise I will do it directly in code as I have with other logs. Just trying to be consistent with my log file naming.