I\'m running Apache2 in a docker container and want to write nothing to the disk, writing logs to stdout and stderr. I\'ve seen a few different ways to do this (Supervisord and
According to the apache mailing list, you can just directly write to /dev/stdio (on Unix like systems) as that's just a regular ol' file handle. Easy! Pasting...
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 /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 /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.
https://mail-archives.apache.org/mod_mbox/httpd-users/201508.mbox/%3CCABx2=D-wdd8FYLkHMqiNOKmOaNYb-tAOB-AsSEf2p=ctd6sMdg@mail.gmail.com%3E