-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Feature request: Have an option to compress log files after their rotation #322
Comments
+1 And even better: with configurable compress program and extension , like gzip/.gz, bzip2/.bz2, xz/.xz. |
+1 - Would definitely like to see this |
+1 |
1 similar comment
+1 |
+1 oh yes! |
+1, it would be great! |
+1 |
4 similar comments
+1 |
+1 |
+1 |
+1 |
+1 |
3 similar comments
+1 |
+1 |
+1 |
Note : Recent versions of logrotate include a maxsize option |
logrotate is not watching logs continuously. By the time logrotate gets around to check for |
+1 |
How about having an option to replacing the rotation scheme ending number with a postfix of date_from-date_to? /my_process.log Pros:
|
If that is a way forward that is acceptable as a patch. I'd be happy to implement it. |
+1 - rather surprised (but the again, not considering issue with logfile ownership) that there's no option to compress rotated logs. |
An implementation effort was made long ago #619 but it was not good enough. Main issue is that Supervisor is implemented on top of an event-loop and file compression might take long time making Supervisor missing important events. |
-1: supervisor has it's features and logrotate has it's own. Let's not duplicate features, I would even prefer for supervisord to notify logrotate to start running. |
Well supervisor has already duplicated the main feature: rotation. This ticket is to add compression to the already existing rotation. But in the end I don't really care whether the actual rotation and/or compression is done by supervisor itself, or by some other software. It is vital though that the rotation happens immediately when the logfile's size reaches its threshold. So how would this look like? I guess supervisor should the not do any rotation (good luck having supervisor rotate, and logrotate only compress. I tried it, and it's a bad idea). There would be a new supervisor directive I have to admit this feels slightly cumbersome. |
@EwaldvanGeffen I totally agree with you. Some time ago I voted a +1 in this same issue, but now I think that tools like supervisor should follow the "unix philosophy", plain and simple: do one thing and do it right; to be a part of the process and not the whole process. Logrotate does provide everything requested in here. Let supervisor do what it does best. Let logrotate do what it does best. For FAQ / RTFM sakes, it is feasible to provide an extra chapter or tutorial or how-to to connect both and that's it. Not only logrotator, but there are a couple of "cloud log tools" around that could be fed by supervisor - like Graphite, as an simple example. The only point that matters here is what @nilstoedtmann stated:
If supervisor guarantees that, I think this issue (and many others) would be satisfied. The idea to set your own rotation settings, also described by @nilstoedtmann, looks like an entry point for this, IMHO. Well, that's just my 2 cents here 🙈 My best regards, |
+1 |
3 similar comments
+1 |
+1 |
+1 |
+1 |
Is it possible to configure logrotate to just do the compression part with supervisor doing the log rotation? I don't see a clean way to do that, so it seems like the behavior most users actually want here is impossible with just combining supervisord as it stands and logrotate. |
+1 |
5 similar comments
+1 |
+1 |
+1 |
+1 |
+1 |
@vltr Could you please add to supervisord documentation how logrotator and supervisor could be coupled? Wouldn't there be problems with race conditions? |
@mristin thanks for bringing my attention to this. I have used supervisor with logrotator some time ago (years) and I don't remember being caught on any race conditions; but I do remember setting some config parameters into logrotator to mitigate the possibility. I don't have any access to this configs anymore since I left the company I used this setup for quite some time now. Sorry for let you without a proper answer on this 😕 |
Perhaps this would be a useful workaround for the lack of a compression option of rotated log files in |
Maybe my version of supervisord is old or something, but this would actually break supervisord’s log rotation in my experience. |
How does this behave when supervisor's rotation and the (potentially slow) cron compression overlap? I smell race conditions. |
can we have at least (simple) i believe, thanks |
I'm confused why that other proposed implementation uses tar to compress multiple (I didn't dig into the PR), but could this also be done asynchronously in [1] yeah, the GIL, but we'd be doing I/O, and maybe supervisord can handle the timeslice sharing anyway since it isn't CPU intensive? |
I'll provide a perspective in the shoes of a mountainous person: we can kill a subprocess safely but not a thread. Plus, this feature request had been there for almost a decade. |
In my opinion, if the log rotation function is not complete, it shouldn't be enabled by default and just depend on |
Is someone (developer) brave enough to close this issue as 'DECLINED' , than keeping issue open for 10 years long?!? Just tell people that there's no way to compress logs, logrotate does not supported, in-application compression is not supported, resistance is futile. Thanks. |
I don't think closing issues for important problems in popular software
just because they've proven difficult to solve and thus remain open for
many years makes sense.
The fact that an issue is open in no way promises an immediate solution,
and I don't think anyone should be pressuring maintainers of the valuable
project to close it as wontfix just because they're sad this feature isn't
implemented.
…-Tim Abbott (mobile)
On Fri, Nov 5, 2021, 04:54 Anatoly Pugachev ***@***.***> wrote:
Is someone (developer) brave enough to close this issue as 'DECLINED' ?
Just tell people that there's no way to compress logs, logrotate does not
supported, in-application compression is not supported, resistance is
futile. Thanks.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#322 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAU6NWSTDUOVQJGFMGEA5ULUKPAXVANCNFSM4AJ7ERWQ>
.
|
I know that there are tools like logrotate that can do rotate-and-compress [1]. But logrotate cannot enforce {streamname} _logfile _maxbytes just-in-time [2]. Therefore i preferred supervisor to handle the rotation.
[1] https://lists.supervisord.org/pipermail/supervisor-users/2010-November/000751.html
[2] I have processes that occasionally, e.g. if certain errors occur, fill logs rapidly. By the time logrotate runs next time, the limited storage on my embedded system is already full.
The text was updated successfully, but these errors were encountered: