• Apache Logs -Stop Logging Certain URIs

    I recently posted an article talking about HAProxy as a load balancer. In the article I spoke about using a HTML health check file to maintain status of each servers Apache instance. The problem is this will flood your Apache server access logs every time this health check occurs, which I believe is every 2 seconds.

    So you end up with a log file like this:
    health check apache logs

    To correct this issue we need to modify the apache2.conf file on each server, and explicitly tell Apache NOT to log this URI to the access logs. So, from the previous article the culprit URI is /healthcheck.html. Open your Apache configuration file.

    Now add this above the CustomLog section:

    NOTICE: Make sure you have the ” escape character for any special characters.

    That’s it! No more spamming of all the health checks to our Apache logs!!

    Sources: