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

Option to gzip log files. #314

Open
ddan39 opened this Issue Jan 23, 2015 · 6 comments

Comments

Projects
None yet
7 participants
@ddan39
Copy link

ddan39 commented Jan 23, 2015

Just noticed my weechat logs are getting quite big, and figured I should gzip them to save space, but then thought maybe we can have weechat write to the files gzipped?

But is this even possible? By the nature of compression, I have a feeling it would not be, unless output is buffered and written in chunks... but I have no idea how gzip actually works :(

and on that note, maybe there is a better lib/algorithm for compressing a text stream?

Please & Thanks :)

@flashcode flashcode changed the title feature request: option to gzip log files, is it even possible? Option to gzip log files, is it even possible? Jan 23, 2015

@flashcode flashcode changed the title Option to gzip log files, is it even possible? Option to gzip log files. Jan 23, 2015

@Shawn-Smith

This comment has been minimized.

Copy link
Contributor

Shawn-Smith commented Jan 23, 2015

If it isn't possible to gzip current logs, maybe just gzipping old ones would be fine. If you have logs set to rotate by day, week or month. When a new log file is made it can gzip the old ones.

@nyuszika7h

This comment has been minimized.

Copy link
Contributor

nyuszika7h commented Mar 20, 2015

It should keep more than one ungzipped log file per buffer though, especially if logs are rotated by day. Maybe it could be a configuration option.

@highflyer77

This comment has been minimized.

Copy link

highflyer77 commented Mar 21, 2015

Maybe just have weechat read the compressed log files using: zcat like other applications do.

Using LOGROTATE(8) would simply handle this job. Logrotate is run as a daily cron job, and a user can set it up however they like.

@NoSuck

This comment has been minimized.

Copy link

NoSuck commented Aug 11, 2016

With ~500 MB of log data, I am interested in this possibility but would be concerned about losing the convenience of readily-available, universally viewable logs.

@nyuszika7h

This comment has been minimized.

Copy link
Contributor

nyuszika7h commented Aug 11, 2016

Well, there is zcat and zgrep, and it could probably automatically (un-)gzip on next start if you change the option.

Sent from my Android device with K-9 Mail. Please excuse my brevity.

@jeaye

This comment has been minimized.

Copy link

jeaye commented Nov 2, 2016

I have 2.0 GB worth of logs that're causing me some space issues right now, but I can't sacrifice the ability to easily search through them with /grep or similar plugins. Having weechat automatically compress these in a way that can be read via weechat would be superb, so this gets my 👍.

In the meantime, a fork of the grep plugin could likely be made to consider rotated, compressed files in its searching. That requires not only a custom plugin, but also a cron/systemd job for logrotating.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment