httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kurtis Rader <>
Subject Re: [users@httpd] Using Httpd & Docker/Kubernetes logging
Date Mon, 17 Aug 2015 04:11:06 GMT
On Sun, Aug 16, 2015 at 8:37 PM, David Aronchick <>

> I'm trying to use httpd in a Docker container. As a general rule, I'm
> trying to write the access & error logs to stdio and stderr instead of
> writing them to disk. Is there a best practice here? I've tried posting to
> stackoverflow, and the best idea given was creating a symlink in the
> container. Is there a way to do this officially?

The most efficient answer depends on your operating system. If you're on a
UNIX like system which provides /dev/stdout and /dev/stderr (or perhaps
/dev/fd/1 and /dev/fd/2) then use those file names. If that isn't an option
use the piped output feature. For example, from my config:

CustomLog "|/usr/sbin/rotatelogs -c -f -l -L
/private/var/log/apache2/test-access.log.%Y-%m-%d 86400     " krader_custom
ErrorLog "|/usr/sbin/rotatelogs -c -f -l -L
/private/var/log/apache2/test-error.log.%Y-%m-%d 86400"

Obviously you'll want to substitute another program for
/usr/sbin/rotatelogs in the example above that writes the data where you
want it to go.

Kurtis Rader
Caretaker of the exceptional canines Junior and Hank

View raw message