I run multiple Linux (Ubuntu) web servers and am looking for a convenient way to keep tabs on important log files. I'd like to monitor pertinent LAMP logs as well as server accesses/logins.

Are there any convenient tools/utilities that will (a) rotate log files, (b) compress them, and (c) email or archive them for later viewing?

link|improve this question

5  
Not as an answer to your question, but you should look at centralizing your logs off-machine. Having all of your logs spooled into the same server assists with finding patterns which can act as precursors to critical errors. – Matt Simmons Jan 8 at 19:03
feedback

2 Answers

up vote 4 down vote accepted

Logrotate will do everything you list above and more e.g.

"/var/log/httpd/access.log" /var/log/httpd/error.log {
    compress
    rotate 5
    mail logs@your.address.example.com
    size 1M
    sharedscripts
    postrotate
        /usr/bin/killall -HUP httpd
    endscript
}

Would mail you the logs that are about to be deleted etc

link|improve this answer
1  
Combine with logwatch and it will break out useful information in easily readable format too, plus its easy to extend. – Mattias Ahnberg Jan 8 at 19:37
1  
Combine with Logstash and you get off-server centralised storage and indexing – Tom O'Connor Jan 8 at 20:22
logstash looks pretty nice. – LVLAaron Jan 8 at 23:01
feedback

How about something like Splunk? I collect 10gb of data per day with it..... :)

link|improve this answer
1  
Its only free up to 500Mbyte per day though, above that it starts to be quite heavily priced. :/ – Mattias Ahnberg Jan 8 at 19:36
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.