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
Is your feature request related to a problem? Please describe.
It would be very helpful to have a single log file for each time an application runs, and to also be able to archive logs from the previous run.
Describe the solution you'd like
A setting could be added to the constructor such as archiveOldFileOnStartup. If set to true the Serilog would delete the current log file. This would trigger OnFileDeleting of any FileLifeCycleHooks
Describe alternatives you've considered
Currently I am using RollingInterval.Hour and retainedFileCountLimit = 1. In combination with a FileLifecycleHooks that will move the File to an archive folder
Additional context
An issue I see is that currently OnFileDeleting seems to be called after the new file is created. This would not work for the desired outcome. Because you would want the old file deleted prior to creating a new file with the same name.
The text was updated successfully, but these errors were encountered:
Thanks for your message. We're not planning to add new rolling policies to this sink at the present time, but #243 (comment) may be what you're after. HTH!
Is your feature request related to a problem? Please describe.
It would be very helpful to have a single log file for each time an application runs, and to also be able to archive logs from the previous run.
Describe the solution you'd like
A setting could be added to the constructor such as archiveOldFileOnStartup. If set to true the Serilog would delete the current log file. This would trigger OnFileDeleting of any FileLifeCycleHooks
Describe alternatives you've considered
Currently I am using RollingInterval.Hour and retainedFileCountLimit = 1. In combination with a FileLifecycleHooks that will move the File to an archive folder
Additional context
An issue I see is that currently OnFileDeleting seems to be called after the new file is created. This would not work for the desired outcome. Because you would want the old file deleted prior to creating a new file with the same name.
The text was updated successfully, but these errors were encountered: