Return-Path: X-Original-To: apmail-httpd-users-archive@www.apache.org Delivered-To: apmail-httpd-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id E901918B5D for ; Mon, 17 Aug 2015 04:11:23 +0000 (UTC) Received: (qmail 16727 invoked by uid 500); 17 Aug 2015 04:11:20 -0000 Delivered-To: apmail-httpd-users-archive@httpd.apache.org Received: (qmail 16689 invoked by uid 500); 17 Aug 2015 04:11:20 -0000 Mailing-List: contact users-help@httpd.apache.org; run by ezmlm Precedence: bulk Reply-To: users@httpd.apache.org list-help: list-unsubscribe: List-Post: List-Id: Delivered-To: mailing list users@httpd.apache.org Received: (qmail 16679 invoked by uid 99); 17 Aug 2015 04:11:20 -0000 Received: from Unknown (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 17 Aug 2015 04:11:20 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id A32DAC0861 for ; Mon, 17 Aug 2015 04:11:19 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 4.731 X-Spam-Level: **** X-Spam-Status: No, score=4.731 tagged_above=-999 required=6.31 tests=[HTML_MESSAGE=3, KAM_INFOUSMEBIZ=0.75, KAM_LAZY_DOMAIN_SECURITY=1, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, URIBL_BLOCKED=0.001] autolearn=disabled Received: from mx1-eu-west.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id WS4gISRC3YYu for ; Mon, 17 Aug 2015 04:11:13 +0000 (UTC) Received: from mail-la0-f42.google.com (mail-la0-f42.google.com [209.85.215.42]) by mx1-eu-west.apache.org (ASF Mail Server at mx1-eu-west.apache.org) with ESMTPS id 0DE1220C24 for ; Mon, 17 Aug 2015 04:11:12 +0000 (UTC) Received: by labd1 with SMTP id d1so71890880lab.1 for ; Sun, 16 Aug 2015 21:11:06 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:content-type; bh=bZr81B2EB77T0R2c5PjSrOrmrx5kX+/gWUxdMERF9qk=; b=JPy5LPlMXuH6TTz6oj5TdEXxYiSvwHexo9UIukF+xwLFlLVF/B+WE/fbr7wLwbzfQ1 +KhFuKS6snCLOO4F/9kYyn5/tjYnBsSVmdJWG2jkttfS1hxHVUUOgsAaJYr7YAo5PKO4 t0Qv4MWW/6Y1kwQ/JV5tfFfBYxCiXxuhyh0oJiq3GYAgC6WUaVY6qEVQeEFfcAxEEdVx xMp+0uAiVH0pRWl9iheInNeqHiGdR4FAXdo1F14En7WahQS/tKVq3wg+AQNBi/mvTnfd 5yghuuviNuE37r06oYWuXL4Y7EIKaiJQTjJnlnSbE5+CxXgHC9O3OgyXkaFxrGOg9ZrQ q4vQ== X-Gm-Message-State: ALoCoQnsk7jiVDTpvuKadm2ruy76tsIan7ZAjJUZTd/XZCGB4k80O4bQvGutFB87ynmxPGe5UB4L MIME-Version: 1.0 X-Received: by 10.152.219.3 with SMTP id pk3mr54009110lac.114.1439784666505; Sun, 16 Aug 2015 21:11:06 -0700 (PDT) Received: by 10.112.124.106 with HTTP; Sun, 16 Aug 2015 21:11:06 -0700 (PDT) In-Reply-To: References: Date: Sun, 16 Aug 2015 21:11:06 -0700 Message-ID: From: Kurtis Rader To: users@httpd.apache.org Content-Type: multipart/alternative; boundary=001a113409d499bda9051d79fdd7 Subject: Re: [users@httpd] Using Httpd & Docker/Kubernetes logging --001a113409d499bda9051d79fdd7 Content-Type: text/plain; charset=UTF-8 On Sun, Aug 16, 2015 at 8:37 PM, David Aronchick 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 --001a113409d499bda9051d79fdd7 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
On S= un, Aug 16, 2015 at 8:37 PM, David Aronchick <aronchick@gmail.com&g= t; wrote:
I'm= trying to use httpd in a Docker container. As a general rule, I'm tryi= ng to write the access & error logs to stdio and stderr instead of writ= ing 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 contai= ner. Is there a way to do this officially?


The m= ost efficient answer depends on your operating system. If you're on a U= NIX 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:

<= /div>
CustomLog "|/usr/sbin/rotatelogs -c -f -l -L /private/var/lo= g/apache2/test-access.log /private/var/log/apache2/test-access.log.%Y-%m-%d= 86400 =C2=A0 =C2=A0 " krader_custom
ErrorLog "|/us= r/sbin/rotatelogs -c -f -l -L /private/var/log/apache2/test-error.log /priv= ate/var/log/apache2/test-error.log.%Y-%m-%d 86400"=C2=A0

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

--
Kurtis Rader
Caretaker of the exceptional canines= Junior and Hank
--001a113409d499bda9051d79fdd7--