-
Notifications
You must be signed in to change notification settings - Fork 8.3k
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
[Logging] Add date-pattern file naming during log-rotation #132400
Comments
Pinging @elastic/kibana-core (Team:Core) |
When I initially implemented the rolling file strategy, I wanted to implement a We could have such date-based strategy not have a Also, we need some kind of 'communication' between the policy and strategy for the date rolling strategy to have more knowledge of the rolling interval, at least for the case of the time based rolling. E.g if the rolling is 24h, but rolls because of log offset at 00:00:02, we still want to use the previous day's date. FWIW log4j itself had to implement a lot of spaghetti code for this policy-to-strategy context. So basically I'm all in for the feature, but I don't have a clear idea how to technically implement it. |
This issue has come up again in a support case. I wonder if we should try to unblock the challenges mentioned in the previous comment. IIUC, there are 3 main points:
Is my understanding correct? Did I miss anything? |
I think implementing this issue would make sense yes, it's a reasonnable enhancement that makes sense and could benefit more than a few customers ihmo.
I think that you listed everything. A few remarks:
For the communication between the various components of the rolling file appender, I used the context as a bridge in #182346, Lines 42 to 53 in 6ca7cbc
And even if the setter/getter pattern is quite ugly, it does the job, and I think we could use the same pattern for any additional communication we need.
Here again, something was started in #182346, as the rolling strategy is now in charge of listing the file for the retention to decide which ones should be deleted. So I think the main concern here is to be able to properly pattern match which file belongs to our appender (so yeah, matching on format), which may be a little challenging but hopefully could be inferred from the file format
Now that I think again about it, I don't think this is an issue on its own. It's mostly about being able to keep track of which file we will be rolling / what should be the next rolling file. Rolling on fixed time instead of by-event don't really solve this by itself (we've already fixed similar issues when rolling during daily saving time change, and rolling at fixed time wouldn't have helped), so it's really about being able to predict which file we're supposed to roll to. |
Currently, Kibana only supports one Rolling strategy:
numeric
We could extend this behaviour with an additional Rolling strategy:
date
, or maybe support thepattern
to declare dates (pattern: %d{yyyy-MM-dd}
)?It could be useful for folks using the Time-interval triggering policy to understand what are the times each log file contains just by looking at the file names.
The text was updated successfully, but these errors were encountered: