-
Notifications
You must be signed in to change notification settings - Fork 118
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Customize filename while using rolling policies #243
Comments
I agree, some custom config to provide a name without date timestamp like 'log.txt' not 'log-220630.txt' |
any update? |
Any News? |
An 'update' and/or 'news' would require a) an agreed spec b) a PR implementing that
|
So it's not possible to let the rolling policy save the file in another folder than the original one? Because I really would need that to keep it organized. |
@ReikoTigon maybe this plugin would work for you: cocowalla/serilog-sinks-file-archive ? |
Hmm if i get the plugin correctly it moves them instead of deleting them? or be able to name the current log sth like "current.log" and all the old logs "log_DATE.log" like it would do atm. |
In NLog, there are some properties such as "archiveEvery" and "archiveDateFormat" that only modify archived files. Is it possible to customize the same for serilog-sinks-file? see: https://nlog-project.org/documentation/v3.2.1/html/Properties_T_NLog_Targets_FileTarget.htm |
Hi folks! Most of this sink's heavy lifting (formatting and so on) is implemented by Serilog ( It's fairly straightforward to wire these things up in a new sink that behaves in one of the ways suggested so far in this thread. Sinks are just simple classes that implement The hesitation to add more filename rolling styles and path formatting here is because although it's not a lot of code to construct a sink for one of these cases targeting one platform, the complexity of trying to support everything in the one sink is likely to turn it into a much heavier package than what we have today, and there's not a lot of enthusiasm for that among the Serilog maintainers as far as I can tell. If anyone's keen to implement their own specific case as a separate sink class, using formatters and so on from the packages mentioned above, and runs into trouble I'd be very happy to help - dropping a question on Stack Overflow tagged Unfortunately although it's nice to have a place to comment, this ticket is likely to be unproductive and noisy so I'll limit further activity to updates from maintainers. If anyone out there makes progress on either an implementation of a standalone sink with different rolling or formatting behavior, or a fork that adds more sophisticated configuration, we can post some links to their work here. |
If customizing filenames is a requirement, and you have the option of choosing your logging framework, you might consider taking a look at NLog, instead. |
There is also a fork of this Sink, |
Hi,
You can log an issue in my repo for more features and requests Would be happy to get your feedback: |
Requesting a out-of-the-box capability to customize a filename while using rolling policies.
The text was updated successfully, but these errors were encountered: