Simon icon Simon
Flexible server monitoring

Best way to monitor a remote Apache error_log file

I'm wondering what would be the best way to do the following. I would like to monitor the error_log file on a remote server (which I have full access to, SSH, SFTP FTP etc.)

I would like to be alerted when the error_log grows but I don't really want to download the whole thing repeatedly.

Every now and then I change a piece of PHP or upgrade an app and then don't notice a bunch of warnings in the error_log.

Best suggestions? I could run a simple cron on the site and put a tail of the file up as a web page and then poll that?

David Sinclair's picture

Re: Best way to monitor a remote Apache error_log file

Yes, that'd work. Since you don't want to fetch the whole file, you'll have to provide a subset of it to Simon.

Another option could be to write a PHP-based page that extracts the tail of the file, rather than using a cron job, so it's always fresh and doesn't run unless needed.

You may be able to use a Script-based service to do the work remotely, too; perhaps SSH into the server and get the tail of the file.