-
Notifications
You must be signed in to change notification settings - Fork 98
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
management of large log files. #142
Comments
On 2/26/2015 4:31 PM, David Vossel wrote:
This sounds like a logrotate issue to me. They get huge on demand (admin The problem of moving and renaming/compressing logs is that can Splitting the log file is easy, compressing it, while code wise is easy, Fabio
|
@fabbione yep, I agree about the compression. This is for logrotate. How about a libqb feature that guarantees the logfile will never get over X bytes long. Log truncating. |
On 2/26/2015 4:51 PM, David Vossel wrote:
hmmm how would you deal with log entries dropped by size? I think the best way would be a new log api that could potentially do:
once the log file >= max_size, then move to %ROTATE_NUMBER%+1.log Being a new function/feature, logrotate snippets can be adapted to deal logrotate by defaults add a suffix to .log, so the 2 number wouldn´t It´s also possible to consider moving files around with the same
|
If the log file gets too large, it's also possible for corosync to fail to start, alleging a configuration failure, with the message
This is probably best addressed in corosync itself (I'm just about to file an issue there), but it seems relevant to this issue too. |
Thanks for mentioning it. I'm not sure we can do much about that here (aside from the management of large files which this issue is really about). If the open call returns an error that we can't deal with then passing it back to the caller seems sensible behaviour to me. |
This can be solved on the application's side by configuring logrotate appropriately:
It might still be useful to implement the equivalent in libqb to be able to rotate sooner than logrotate's next run, but that seems a small benefit for a lot of work, so I'd be inclined to just close this. |
I'll add an API call to re-open the log, that's pretty easy to do and allows for applications to do their own log management (it'll have the option to open a new filename). If you don't need it, don't use it :) |
Definitely a good idea, but that solves issue #239 rather than this :) |
Good point. I'll close this one then as it doesn't seem to be generally regarded as a good idea. Thanks. |
For pacemaker and corosync, when debug/trace logging levels are in use the log files get huge. On long running systems, it is possible for the log files to actually fill the disk.
An idea we have to help with this is to split logfiles after they reach a certain size and compress the archived files. I'm unsure how feasible this feature request is. It needs research.
The text was updated successfully, but these errors were encountered: