Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 39E71200C63 for ; Thu, 11 May 2017 20:37:23 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 38679160BC7; Thu, 11 May 2017 18:37:23 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 30804160BB3 for ; Thu, 11 May 2017 20:37:22 +0200 (CEST) Received: (qmail 58534 invoked by uid 500); 11 May 2017 18:37: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 58524 invoked by uid 99); 11 May 2017 18:37:20 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 11 May 2017 18:37:20 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 89E69185E85 for ; Thu, 11 May 2017 18:37:20 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -0.302 X-Spam-Level: X-Spam-Status: No, score=-0.302 tagged_above=-999 required=6.31 tests=[HTML_MESSAGE=2, RCVD_IN_DNSWL_MED=-2.3, RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id OR9nOiSDpPcY for ; Thu, 11 May 2017 18:37:18 +0000 (UTC) Received: from mx2.hsr.ch (mx2.hsr.ch [152.96.36.32]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTPS id E06695F398 for ; Thu, 11 May 2017 18:37:17 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mx2.hsr.ch (Postfix) with ESMTP id 2F5D923C5F37 for ; Thu, 11 May 2017 20:37:10 +0200 (CEST) Received: from mx2.hsr.ch ([127.0.0.1]) by localhost (mx2.hsr.ch [127.0.0.1]) (amavisd-new, port 10024) with LMTP id w-wJ3KnllU7R for ; Thu, 11 May 2017 20:37:07 +0200 (CEST) Received: from webmail.hsr.ch (unknown [152.96.21.229]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mx2.hsr.ch (Postfix) with ESMTPS id 8CAF023C5F36 for ; Thu, 11 May 2017 20:37:06 +0200 (CEST) Received: from sidv0231.hsr.ch (152.96.21.229) by sidv0231.hsr.ch (152.96.21.229) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.669.32; Thu, 11 May 2017 20:37:06 +0200 Received: from sidv0231.hsr.ch ([152.96.21.229]) by sidv0231.hsr.ch ([152.96.21.229]) with mapi id 15.01.0669.032; Thu, 11 May 2017 20:37:06 +0200 From: KASPAR Sandro To: "users@httpd.apache.org" Thread-Topic: [users@httpd] cgi script error output logging Thread-Index: AQHSyZWknuS3GhMRdkCnUBwQq4Uam6HucMmAgABTUkKAADJmgIAAf4Aq Date: Thu, 11 May 2017 18:37:06 +0000 Message-ID: References: <4b6248bf-d55c-59e0-3dd3-4b0cf7754da0@ayni.com> , In-Reply-To: Accept-Language: en-US, de-CH Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [152.96.21.199] Content-Type: multipart/alternative; boundary="_000_e57388af118a474aab94b0eeff705608hsrch_" MIME-Version: 1.0 Subject: Re: [users@httpd] cgi script error output logging archived-at: Thu, 11 May 2017 18:37:23 -0000 --_000_e57388af118a474aab94b0eeff705608hsrch_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Hi Luca, Yes I checked the error log format. Unfortunately, this only applies to log= lines generated by apache and not to the lines created by cgi scripts. The= lines created by a cgi script are just redirected to the httpd-error.log a= s they are. For example if you print "test" to stderr in a cgi script, this= gets written just like that to the error log. No vhost information, no tim= estamp, no user, just what you printed. My error log format is: ErrorLogFormat "%v [%{u}t] [%-m:%l] [pid %P:tid %T] %7F: %E: [client\ %a] %= M% ,\ referer\ %{Referer}i" But as I said, the ErrorLogFormat is not applied to log lines generated by = cgi scripts. The apache version I am using is 2.4.25. Sandro ________________________________ From: Luca Toscano Sent: Thursday, May 11, 2017 2:53:35 PM To: users@httpd.apache.org Subject: Re: [users@httpd] cgi script error output logging Hi Sandro, have you checked https://httpd.apache.org/docs/2.4/mod/core.html#errorlogfo= rmat ? What is the current format that you are using? Also, what version of= httpd? Luca 2017-05-11 10:07 GMT+02:00 KASPAR Sandro >: Hi suomi, Thank you for your answer. Unfortunately I am not using php-fpm but fcgid. = As far as I know there is no such possibility in fcgid. Any other ideas? Sandro ________________________________ From: fedora > Sent: Thursday, May 11, 2017 6:54 AM To: users@httpd.apache.org Subject: Re: [users@httpd] cgi script error output logging Hi Sandro are you using php-fpm as a cgi frontend? If yes: the stdout and stderr are both redirectet to the php-fpm log (/var/log/php-fpm/*) if you have in /etc/php-fpm/www.conf: catch_workers_output =3D yes I don't think this will solve all your problems, but it is a good starting point. suomi On 05/10/2017 03:59 PM, KASPAR Sandro wrote: > > Hi, > > According to this documentation http://httpd.apache.org/docs/2.4/logs.htm= l everything a cgi script sends to stderr is written to the apache error l= og file. > > Unfortunately I can not control those scripts running on my server and of= ten garbage is sent to stderr and then written to my error log. Because the= re isn't even a timestamp or any other useful information on those lines, I= can't find out, which vhost created the error. In addition those log line= s often lack a "new line" at the end, and it the next log message gets appe= nded to the current line instead of being written to a new line. Because of= this, the next line which would have been in the correct format is also lo= st, because it can't be parsed automatically anymore. > > Is there any way to change this behaviour? What I would like to achieve i= s to have the cgi errors in a seperate logfile or even better change the lo= g format of these lines. For example prefix the log line with the vhost and= a timestamp. > Because I don't have control over the cgi scripts, I would need to config= ure this in apaches main or vhost configuration. Unfortunately I could not = find anything about cgi script output logging in the apache documentation (= except that everything sent to stderr is written to httpd-error.log) or ma= iling list archives. > > Any ideas appreciated. Thanks in advance! > > Sandro Kaspar > --------------------------------------------------------------------- > To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org > For additional commands, e-mail: users-help@httpd.apache.org > --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org For additional commands, e-mail: users-help@httpd.apache.org --_000_e57388af118a474aab94b0eeff705608hsrch_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

Hi Luca,


Yes I checked the error log format. Unfortunately, this only applies to = log lines generated by apache and not to the lines created by cgi scripts. = The lines created by a cgi script are just redirected to the httpd-error.lo= g as they are. For example if you print "test" to stderr in a cgi script, this gets written just l= ike that to the error log. No vhost information, no timestamp, no user, jus= t what you printed.

My error log format is: 


ErrorLogFormat "%v [%{u}t] [%-m:%l] [pid %P:tid %T] %7F: %E: = [client\ %a] %M% ,\ referer\ %{Referer}i"


But as I said, the ErrorLogFormat is not applied to log lines gene= rated by cgi scripts.

The apache version I am using is 2.4.25. 


Sandro


From: Luca Toscano <tosc= ano.luca@gmail.com>
Sent: Thursday, May 11, 2017 2:53:35 PM
To: users@httpd.apache.org
Subject: Re: [users@httpd] cgi script error output logging
 
Hi Sandro,

have you checked https://httpd.apache.org/docs/2.4/mod/core.html#= errorlogformat ? What is the current format that you are using? Also, w= hat version of httpd?

Luca

2017-05-11 10:07 GMT+02:00 KASPAR Sandro <sandro.kaspar= @hsr.ch>:

Hi suomi,


Thank you for your answer. Unfortunately I am not using php-fpm but fcgi= d. As far as I know there is no such possibility in fcgid. 

Any other ideas?


Sandro



Fr= om: fedora <fed= ora@ayni.com>
Sent: Thursday, May 11, 2017 6:54 AM
To: user= s@httpd.apache.org
Subject: Re: [users@httpd] cgi script error output logging
 
Hi Sandro

are you using php-fpm as a cgi frontend? If yes: the stdout and stderr
are both redirectet to the php-fpm log (/var/log/php-fpm/*) if you have
in /etc/php-fpm/www.conf:

catch_workers_output =3D yes

I don't think this will solve all your problems, but it is a good
starting point.

suomi

On 05/10/2017 03:59 PM, KASPAR Sandro wrote:
>
> Hi,
>
> According to this documentation http://httpd.apache.org/docs/2.4/logs.html everything a cgi script= sends to stderr is written to the apache  error log file.
>
> Unfortunately I can not control those scripts running on my server and= often garbage is sent to stderr and then written to my error log. Because = there isn't even a timestamp or any other useful information on those lines= , I can't find out, which vhost created  the error. In addition those log lines often lack a "new line" a= t the end, and it the next log message gets appended to the current line in= stead of being written to a new line. Because of this, the next line which = would have been in the correct format is also lost, because it can't be parsed automatically anymore.
>
> Is there any way to change this behaviour? What I would like to achiev= e is to have the cgi errors in a seperate logfile or even better change the= log format of these lines. For example prefix the log line with the vhost = and a timestamp.
> Because I don't have control over the cgi scripts, I would need to con= figure this in apaches main or vhost configuration. Unfortunately I could n= ot find anything about cgi script output logging in the apache documentatio= n (except that everything sent to  stderr is written to httpd-error.log) or mailing list archives.
>  
> Any ideas appreciated. Thanks in advance!
>
> Sandro Kaspar
> ------------------------------------------------------------= ---------
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>

-----------------------------------------------------------------= ----
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


--_000_e57388af118a474aab94b0eeff705608hsrch_--