Redirecting apache access_log and error_log to the systemd journal

Posted by Harald Hoyer on 7 November 2013

To redirect all apache messages to syslog, which will then appear in the systemd journal modify your httpd.conf:

CustomLog "|/bin/logger -t access_log -p" "%v %h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-agent}i\""``
ErrorLog syslog:user

Of course it would be much nicer, if apache actually could use the journal directly.

[Edit]: Apparently with apache 2.5, there will be a mod_journald :-)