You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by David Aronchick <ar...@gmail.com> on 2015/08/17 05:37:12 UTC

[users@httpd] Using Httpd & Docker/Kubernetes logging

Hi--

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?

http://stackoverflow.com/posts/32013582

Thanks!

Re: [users@httpd] Using Httpd & Docker/Kubernetes logging

Posted by Kurtis Rader <kr...@skepticism.us>.
On Sun, Aug 16, 2015 at 8:37 PM, David Aronchick <ar...@gmail.com>
wrote:

> 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?
>
> http://stackoverflow.com/posts/32013582
>

FYI, That URL isn't valid; it results in a "page not found" error from
Stack Overflow.

-- 
Kurtis Rader
Caretaker of the exceptional canines Junior and Hank

Re: [users@httpd] Using Httpd & Docker/Kubernetes logging

Posted by Kurtis Rader <kr...@skepticism.us>.
On Sun, Aug 16, 2015 at 8:37 PM, David Aronchick <ar...@gmail.com>
wrote:

> 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?
>
> http://stackoverflow.com/posts/32013582
>

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.

-- 
Kurtis Rader
Caretaker of the exceptional canines Junior and Hank