Mailing List Archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[tlug] Re: Apache: Logging: how-to pipe logs or log toanothermachine (was Disk



Jean-Christian Imbeault wrote:

> I was hoping to have apache logs be compressed "on-the-fly" as they were 
> being written to disk. I.e. as apache is appending to it's log file have 
> the entries are zipped before being added to the log file.
> 
> I guess it just isn't possible?

It would be possible, but it isn't feasible to gzip single log entries.
(Which such a directive would do I assume)
However, you could do something along the lines of this, which would
yield usable compression factors:

mkfifo /var/log/apachelog.fifo
(while [ ! -f /tmp/stop_apachelog ]; do cat /var/log/apache.fifo; done; rm -f /tmp/stop_apachelog) | gzip -c > /var/log/apachelog.gz

Now when you want to rotate the logfile, you create /tmp/stop_apachelog,
wait until it no longer exists, rotate the gzipped logfile and
restart...

-- 
Tobias								PGP: 0x9AC7E0BC
This mail is made of 100% recycled bits
Now playing: iwasuinoriyuki (IWADARE Noriyuki) - Lucia vs. Zophar

Attachment: pgp00092.pgp
Description: PGP signature


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links