Skip to content
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

feat: ability to specify multiplier for rollingInterval #308

Closed
NyanHeart opened this issue Feb 20, 2024 · 1 comment
Closed

feat: ability to specify multiplier for rollingInterval #308

NyanHeart opened this issue Feb 20, 2024 · 1 comment

Comments

@NyanHeart
Copy link

Just like:

Log.Logger = new LoggerConfiguration().WriteTo.File("log.txt", LogEventLevel.Debug, 
                               rollingInterval:RollingInterval.Day, intervalMultipiler:5).CreateLogger();

Then the log file will roll every 5 days.

@bartelink bartelink changed the title Request support for adding a multiplier to the Interval of RollingFile to achieve custom time interval functionality. feat: ability to specify multiplier for rollingInterval Feb 21, 2024
@bartelink
Copy link
Member

This likely has significant overlaps with the concern of how rolling files are named; the intervals drive the naming, and that would likely need to change to accommodate such a feature
The naming aspect is covered in #243


See also link to some more discussions, and a fork of this sink in #243 (comment)

If you feel 243 does not yet cover your need, can you add a version of your requirement as a comment there please?


Closing the issue in order to keep this issue list tractable for when anyone anywhere gets capacity to do some feature enhancements (but please note that this sink is used in a massive number of environments, and the fact it has proven resilient and not requiring constant bugfixing whackamole releases is a feature, so the bar is high for any enhancement that induces risk of unpredictable behavior, or complexity in general)

My personal view is that size and monthly are better ways to decide rolling than multiples of intervals - ultimately if a month is too much data, then having approx 1/6th of that is not going to be world changing either, and the idea does not generalize for the other ones. Perhaps a Weekly interval might be possible (i.e. base the file name on the Week number within the year, but that naming would need to coexist with the month/day naming)

So I guess I'm calling it a misfeature; but not necessarily ruling out some way to give you what you want if 243 provides a good solution

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants