serilog-sinks-file-archive
serilog-sinks-file-archive copied to clipboard
Add new replacement tokens
It would be nice to have token like logDate
whose value is taken from the log file name (instead of current date&time). If the app has retention 5 days and I stop it on 2021-02-28 and run it again on 2021-03-05, last 5 files of february logs will be compressed into "march directory“.
Btw. thank You for the great job. This hook bring essential logging feature from Linux into .NET world without any external tools :)
Some notes on this:
- Serilog uses a fixed set of date format tokens
- Each token has a different number of characters
- The token is always placed at the end of the filename - no user-defined text can come afterwards
So, I think this should be doable, just using a regex to extract the date from the filename.