httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin Langhoff <>
Subject [users@httpd] compresslog: pipe log through gzip without the headaches
Date Sat, 14 Sep 2013 15:07:15 GMT
[ Using piped logs with gzip is rather painful. Here is what I came up
with to improve the "user experience". Getting the scripts right so
that no data was lost in normal operation is non-trivial, so I thought
I'd share. ]

=compresslog README=

Save a ton of disk IO (or SAN traffic) in your webserver setups, not
losing any log entries and retaining ease of debugging and

Piped logs to gzip unfortunately loses significant amounts of log data upon stop
and restart; and prevents use of tail, which complicates diagnostics
of live systems.

With compresslog:

 * Use piped logs to compress your Apache logs with zlib compression.
 * Resulting files are valid gzip files.
 * The compression process adds significant buffering.
 * Buffering does not lose data in the event of stops and restarts.
 * Includes ztail utility -- equivalent to tail -n 10 -f yourlog
   which flushes buffers appropriately.

Find it at:

Patches, comments and beers welcome.


ps: I am subscribed to digest -- please CC me in replies :-)
 -  ask interesting questions
 - don't get distracted with shiny stuff  - working code first

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message