You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I don't really understand why it wasn't built in, but this handler should compress the old logs.
6.9G Dec 29 11:47 archive.log.2017-12-27
394M Dec 29 11:47 archive.log.2017-12-27.gz
Having a log this size uncompressed, and more than one, is just pointless and dumb. This is the perfect candidate for compression from this large number to a significantly smaller number. As one sees with the same file compressed with the highest compression (-9) above in gzip.
Looking at the ArchiveHandler code, it looks like it does some kind of rotation using Python's logging.handlers.TimedRotatingFileHandler. When instantiating, the handler code passes an encoding. By default, this is empty but it can be configured as part of the handler's config.
Could you try setting encoding = bz2 in the config and see if that works? Thanks.
@DStape I am not in an environment where I have to worry about this right now (or am even using it for the moment), but @jasonhancock may be able to test it as he is in the same environment I was in still. He's definitely got some logs he could use this on.
Activity
DStape commentedon Mar 21, 2018
Hi @gehzumteufel,
Looking at the ArchiveHandler code, it looks like it does some kind of rotation using Python's
logging.handlers.TimedRotatingFileHandler. When instantiating, the handler code passes an encoding. By default, this is empty but it can be configured as part of the handler's config.Could you try setting
encoding = bz2in the config and see if that works? Thanks.DStape commentedon Mar 21, 2018
(Just to note,
encodingis listed as a config option in the documentation (https://diamond.readthedocs.io/en/latest/handlers/ArchiveHandler/), but maybe we should update that to include examples to make what it does more obvious.bengaywins commentedon Mar 26, 2018
@DStape I am not in an environment where I have to worry about this right now (or am even using it for the moment), but @jasonhancock may be able to test it as he is in the same environment I was in still. He's definitely got some logs he could use this on.
jasonsattler commentedon Apr 30, 2018
Looks like the
encodingoption worked. I think just adding a quick description and valid values would help.