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?

  • 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. Jan 8 '12 at 19:03

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

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

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

  • 1
    Combine with logwatch and it will break out useful information in easily readable format too, plus its easy to extend. Jan 8 '12 at 19:37
  • 1
    Combine with Logstash and you get off-server centralised storage and indexing Jan 8 '12 at 20:22
  • logstash looks pretty nice.
    – LVLAaron
    Jan 8 '12 at 23:01

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

  • 1
    Its only free up to 500Mbyte per day though, above that it starts to be quite heavily priced. :/ Jan 8 '12 at 19:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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