-
Notifications
You must be signed in to change notification settings - Fork 4.4k
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
log rotate file name postfix can be formatted? #9287
Comments
Hi @riverlee2014 , Can you explain more abut your usecase? What format would you want there? I don't think this is a big ask, and I could see how wanting a more readable time/date format might be nice, but I'm curious of the application. Best, |
Hi, @jsosulska , info-1606459202259806039.log
info-1606372739843526258.log
info-1606286280091474531.log
info-1606197194984836618.log
info-1606110075297491022.log It makes us confused which one corresponds to which day? "log_file" : "/var/log/consul-{YYYY-MM-dd}.log" So the log file names make it fast to read in human format. Thank you! |
It certainly would be better to have a more direct option to see a human readable date, but a potential workaround for anyone with this same question to consider in the meantime: View the file creation time for all the files, e.g.,:
|
Hi @riverlee2014, The Unix timestamp currently has nanosecond resolution to prevent filename conflicts. We'd want to do something similar with a human-readable timestamp. It could like something like this: Q: Is it sufficient for your use case if all you can do is choose whether the timestamp suffix is a Unix timestamp or a more human-readable timestamp (like above)? Or is there a need in your use case for more fine-grained control, such as with a templating system? |
This format with human tags can already meet our scene. Thank you! |
Full templating has more design complexities that we haven't fully worked through yet. An alternative which is perhaps easier would be having a separate config like Would that work for your use case? And is there a benefit to you to have more control than this (such as with a templating option)? |
I have use log rotate configuration, but log file name is end with number, It's hard to find the target file.
Is there any format config parameter?
The text was updated successfully, but these errors were encountered: