I wounder how to setup Serilog.Sinks.File to produce this:
log.txt <-- current log
log20200704.txt <-- rolled over yesterday log
log20200703.txt
instead of:
log20200705.txt <-- current log
log20200704.txt <-- rolled over yesterday log
log20200703.txt
I am used to such behavior since log4net days.
This is currently not supported by the Serilog.Sinks.File
and there are no plans to support it in the short term. You can see a long discussion around this on the link below:
Fixed filename with rolling archive files #40
You can see an initial attempt to add this feature as a separate package (though it's still early days and has known limitations) on this repository: https://github.com/dfacto-lab/serilog-sinks-file
Of course, you can always roll your own version of Serilog.Sinks.File
that adds the behavior you're looking for.
Other, related links:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With