2

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?

1
  • 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
4

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

3
  • 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
2

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

1
  • 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.