Skip to main content Logo

Quis custodiet ipsos custodes?
Home | About | All pages | Cluster Status | RSS Feed

Apache access/error log to syslog

Published: 15-12-2013 | Author: Remy van Elst | Text only version of this article

❗ This post is over ten years old. It may no longer be up to date. Opinions may have changed.

This snippet shows you how to redirect the Apache access log to syslog using the Customlog statement, and the Error log to syslog via the ErrorLog statement.

Recently I removed all Google Ads from this site due to their invasive tracking, as well as Google Analytics. Please, if you found this content useful, consider a small donation using any of the options below:

I'm developing an open source monitoring app called Leaf Node Monitoring, for windows, linux & android. Go check it out!

Consider sponsoring me on Github. It means the world to me if you show your appreciation and you'll help pay the server costs.

You can also sponsor me by getting a Digital Ocean VPS. With this referral link you'll get $200 credit for 60 days. Spend $25 after your credit expires and I'll get $25!

Using the double pipe prevents spawning a shell for every hit. Append the below line to a vhost to have everything logged to syslog.

CustomLog "||/usr/bin/logger -t apache -i -p local5.notice" combine

The error log can be appended to syslog using the following statement:

 ErrorLog syslog:local6
Tags: acces-log , apache , error-log , log , logging , snippets , syslog