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?

hayalci
  • 3,631
  • 3
  • 27
  • 37
Trent Scott
  • 959
  • 1
  • 12
  • 28
  • 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 08 '12 at 19:03

2 Answers2

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

user9517
  • 115,471
  • 20
  • 215
  • 297
2

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

LVLAaron
  • 436
  • 6
  • 13