Huge Apache Error Log from Solaris 10 LicenseWatcher

Working on a client site recently, I noticed their Apache error log had grown to 32 Gb in size. The file was being written to at a rate of a quarter of a million lines a day, propelled by various cron jobs set up to run every 5 minutes. A PHP reconfiguration fixed the problem.

The box was a Solaris 10 system running “License Watcher“, and those messages was all coming from the License Watcher php code. Not genuine errors, just repeated diagnostics. I edited /usr/local/php/lib/php.ini and changed this line

error_reporting = E_ALL


error_reporting = E_ALL & ~E_DEPRECATED & -E_WARNING

Then restarted Apache with svcadm. The flow of diagnostic messages changed to a sensible level, in fact it almost stopped.

rm Behaviour with Large Files

The Apache log file, error.log, was deleted with an rm command which returned almost immediately. About 10 seconds later the space started to be freed very fast, according to df, and was completely freed in about another 15 seconds.

Gauging File Growth

A head on the error.log file showed the first few error lines and their dates. Comparing those with the size of the file, and estimating the average line length, gave the average file growth of about a quarter of a million lines per day. At no point did I do a wc on the file, because it would have taken ages to complete.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.