You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Ewald Dieterich <ew...@mailbox.org> on 2017/08/17 07:09:19 UTC

Piped logging, graceful restart, broken pipe

I configured CustomLog with a pipe:

CustomLog "|/usr/bin/logger -p local1.info -t apache2" combined

Now I start downloading a large file. During this download I gracefully 
restart Apache. The download continues of course. But when the download 
is finished I don't get an entry in the access log, instead I get this 
message in the error log:

(32)Broken pipe: [...] AH00646: Error writing to |/usr/bin/logger -p 
local1.info -t apache2

It looks like the graceful restart doesn't account for the 
/usr/bin/logger process still being required until the last worker 
finished. I.e. the graceful restart kills the running /usr/bin/logger 
immediately and starts a new one.

Is this something that can be fixed? Or am I doing something wrong here?

Re: Piped logging, graceful restart, broken pipe

Posted by Jacob Perkins <ja...@cpanel.net>.
Our clients / customers have been hitting this issue as well. 

—
Jacob Perkins
Product Owner
cPanel Inc.

jacob.perkins@cpanel.net <ma...@cpanel.net>
Office:  713-529-0800 x 4046
Cell:  713-560-8655

> On Aug 17, 2017, at 2:09 AM, Ewald Dieterich <ew...@mailbox.org> wrote:
> 
> I configured CustomLog with a pipe:
> 
> CustomLog "|/usr/bin/logger -p local1.info -t apache2" combined
> 
> Now I start downloading a large file. During this download I gracefully restart Apache. The download continues of course. But when the download is finished I don't get an entry in the access log, instead I get this message in the error log:
> 
> (32)Broken pipe: [...] AH00646: Error writing to |/usr/bin/logger -p local1.info -t apache2
> 
> It looks like the graceful restart doesn't account for the /usr/bin/logger process still being required until the last worker finished. I.e. the graceful restart kills the running /usr/bin/logger immediately and starts a new one.
> 
> Is this something that can be fixed? Or am I doing something wrong here?


Re: Piped logging, graceful restart, broken pipe

Posted by Ewald Dieterich <ew...@mailbox.org>.
On 17.08.2017 19:21, Eric Covener wrote:
> On Thu, Aug 17, 2017 at 3:09 AM, Ewald Dieterich <ew...@mailbox.org> wrote:
>> I configured CustomLog with a pipe:
>>
>> CustomLog "|/usr/bin/logger -p local1.info -t apache2" combined
>>
>> I get this message in the error log:
>>
>> (32)Broken pipe: [...] AH00646: Error writing to |/usr/bin/logger -p
>> local1.info -t apache2
>>
>> Is this something that can be fixed? Or am I doing something wrong here?
> 
> I think it's a design problem. The last time it was discussed was
> "rotatelogs and SIGTERM?
Is there a reason why CustomLog doesn't support logging directly to 
syslog like ErrorLog does? Like this:

CustomLog syslog:local1

That would solve my problem (I just want all access log entries to go to 
syslog) and also the log rotation problem since Apache wouldn't need to 
worry about this anymore. You could configure log rotation completely 
outside the scope of Apache.

One limitation that ErrorLog mentions is that the syslog facility is 
effectively global, but I don't think that would break the feature.

Would do you think? Are there any other problems with this approach?

Re: Piped logging, graceful restart, broken pipe

Posted by Eric Covener <co...@gmail.com>.
On Thu, Aug 17, 2017 at 3:09 AM, Ewald Dieterich <ew...@mailbox.org> wrote:
> I configured CustomLog with a pipe:
>
> CustomLog "|/usr/bin/logger -p local1.info -t apache2" combined
>
> Now I start downloading a large file. During this download I gracefully
> restart Apache. The download continues of course. But when the download is
> finished I don't get an entry in the access log, instead I get this message
> in the error log:
>
> (32)Broken pipe: [...] AH00646: Error writing to |/usr/bin/logger -p
> local1.info -t apache2
>
> It looks like the graceful restart doesn't account for the /usr/bin/logger
> process still being required until the last worker finished. I.e. the
> graceful restart kills the running /usr/bin/logger immediately and starts a
> new one.
>
> Is this something that can be fixed? Or am I doing something wrong here?


I think it's a design problem. The last time it was discussed was
"rotatelogs and SIGTERM?"