Monitor Website Error Logs via Backups

Many website applications generate error logs sprinkled throughout their directory structure. For example, WordPress has hidden error logs even though you might not have enabled them via the “WP_DEBUG” directive in wp-config.php. It’s hard to keep track of all these logs on a daily basis.

A little while back, I had written about using DropMySite as a preferred alternative to CodeGuard and Jetpack. When I started using it as a backup service however, I discovered an unexpected bonus – I was able to monitor my error logs easily everyday!

Here’s how.

Backup Services Monitor Changed Files

One of the ways by which backup services like CodeGuard and DropMySite save bandwidth and processing power, is by implementing incremental or differential backups – that is after the initial upload, they only save changed or new files for future backups. This puts them in a prime position to alert you when a file has been changed or added to.

For example, here’s a screenshot of the “Modified Files” tab in the DropMySite backup snapshot showing that the “php_errorlog” file has been modified since the last time the backup ran:

DropMySite Modified Error Log
DropMySite Modified Error Log

Error logs in websites are the perfect example of files that change on a regular basis, even when there haven’t been any updates to the site (or even the database). And since the backup service scans your entire site every day, it picks up even the most esoteric error logs that haven’t been documented.

Monitor Hidden Logs Too

Proper documentation of error logs is often a problem. I remember managing Linux servers and trying to locate the source of a particular error by searching the logs, only to find conflating answers about which error logs to check. There are so many of them! Each application has its own log, the system itself has multiple files scattered throughout dozens of directories. It can be a nightmare to find them all and see which ones contain the specific error that you’re looking for.

But when you have a backup service running regularly, you can monitor all these error logs at once and quickly go through them. Typically, the backup service will also do a line by line comparison and tell you exactly what the changes are.

Example of a WordPress “Hidden” Error Log

My latest backups on DropMySite show me a curious error log hidden away in the “ID3” directory of wp-includes with the following error message:

Uncaught Error: Class ‘getid3_handler’ not found

Here’s a screenshot:

Hidden Error Log in WordPress
Hidden Error Log in WordPress

Now this error log isn’t mentioned anywhere in the WordPress documentation. Apparently, it happens when someone who’s trying to hack your site, directly accesses a PHP file inside wp-includes. I’ve written an article on NameHero about how to address this problem. One thing’s for sure though – without a backup service like DropMySite showing me which files are changing on a daily basis, I would never have caught this in the first place.

Some Web Hosts with Backup Add-Ons

Not all web hosts have backup add-ons from professional services. Some, like Siteground, implement their own backup solutions. While these do a good job, they don’t show you the modified files and the specific lines that have changed. So here are three web hosts that have professional backup add-ons:

  1. Hostgator: CodeGuard – $2/m for 1 GB
    List of Hostgator discounts
  2. Bluehost: Codeguard – Same as Hostgator
    List of Bluehost coupons
  3. NameHero: DropMySite – $2/m for 5 GB
    List of NameHero coupons

As mentioned before, I prefer DropMySite to CodeGuard because of the pricing, and you pay just for storage instead of on a “per site” basis. But for purposes of monitoring your error logs, they both do a great job!

About Bhagwad Park

I've been writing about web hosting and WordPress tutorials since 2008. I also create tutorials on Linux server administration, and have a ton of experience with web hosting products. Contact me via e-mail!

Speak Your Mind