Re: Apache logging

2010-09-14 Thread Stefan Fritsch
On Monday 13 September 2010, Sergio Junqueira wrote:
 Do you need the first entry to determine which request may have
 caused httpd to  crash or is there a different reason?
 
 Mod_log_forensics writes the log record as soon as it is received. 
 Mod_log_config writes the log record after the response is
 available. I don´t  want to miss information about any request.
 Its  important to identify all incoming requests, no matter if
 they fail or succeed.

 I would like to trace them having a small log record from the
 incoming requests. Useful to determine which request may have
 caused httpd to crash, as you  mentioned, and to have 100%
 guarantee that all incoming requests were logged before Apache
 started processing it.
 
 Does mod_log_config always writes a log record for all incoming
 requests, no matter where or when they failed in the processing
 chain? If this is the case, mod_log_config provides the %D format
 to determine when the incoming request was received and it seems
 the current mod_log_config record would provide the information I
 need.

No, if a child crashes, there is only an entry in the error log about 
the crash but no details about the requests in progress.  
Mod_log_forensics would be an easier way to get those than 
mod_whatkilledus (which requires recompiling with --enable-exception-
hook IIRC).

Sergio, it would be nice if you could file an enhancement request in 
bugzilla, so that this idea is not lost.

Cheers,
Stefan




Re: Apache logging

2010-09-13 Thread Igor Galić

- Sergio Junqueira sjjrb...@yahoo.com wrote:

 Do you need the first entry to determine which request may have
 caused httpd to crash or is there a different reason?
 
 
 Mod_log_forensics writes the log record as soon as it is received.
 Mod_log_config writes the log record after the response is available.
 I don´t want to miss information about any request. Its important to
 identify all incoming requests, no matter if they fail or succeed.
 
 
 I would like to trace them having a small log record from the incoming
 requests. Useful to determine which request may have caused httpd to
 crash, as you mentioned, and to have 100% guarantee that all incoming
 requests were logged before Apache started processing it.


Have you already exhausted other methods such as mod_whatkilledus?

bye,
i
-- 
Igor Galić

Tel: +43 (0) 664 886 22 883
Mail: i.ga...@brainsware.org
URL: http://brainsware.org/


Re: Apache logging

2010-09-13 Thread Sergio Junqueira
 Have you already exhausted other methods such as mod_whatkilledus?

Not yet. I didn't know about it. But my main concern now is to account for all 
incoming requests, no matter if they fail. I need to identify every request 
received by Apache, when it was received, when and if a response was sent or if 
the request failed. 

Thanks,



From: Igor Galić @brainsware.org
To: dev@httpd.apache.org
Sent: Mon, September 13, 2010 3:51:47 AM
Subject: Re: Apache logging


- Sergio Junqueira @yahoo.com wrote:

 Do you need the first entry to determine which request may have
 caused httpd to crash or is there a different reason?
 
 
 Mod_log_forensics writes the log record as soon as it is received.
 Mod_log_config writes the log record after the response is available.
 I don´t want to miss information about any request. Its important to
 identify all incoming requests, no matter if they fail or succeed.
 
 
 I would like to trace them having a small log record from the incoming
 requests. Useful to determine which request may have caused httpd to
 crash, as you mentioned, and to have 100% guarantee that all incoming
 requests were logged before Apache started processing it.


Have you already exhausted other methods such as mod_whatkilledus?

bye,
i
-- 
Igor Galić

Tel: +43 (0) 664 886 22 883
Mail: i.ga...@brainsware.org
URL: http://brainsware.org/



  

Re: Apache logging

2010-09-12 Thread Stefan Fritsch

On Fri, 10 Sep 2010, Sergio Junqueira wrote:


I have a suggestion for the developers of Apache related to mod_log_config or
mod_log_forensics:

1) To allow mod_log_config to write the log file with a first log entry with
basic information about the request before it's processed further (that is,
after receiving the headers). The second log entry (the current logging format)
would be written after the request processing. A log ID, just like the
forensic ID, should be available on both entries.

2)- Or to allow mod_log_forensic to be configured not to write all headers to
disk. For instance, we should be able to configure it just like we do with
LogFormat on mod_log_config. Or at least allow us to choose to write just the
1st request line, without all the headers.


I think 2) would be a reasonable feature request for mod_log_forensic and 
would be easy to implement. However, I am interested about your actual use 
case. Do you need the first entry to determine which request may have 
caused httpd to crash or is there a different reason?



If you are generally interested in better logging in httpd, you may want 
to read and possibly comment about some new features in 2.3/2.4:


http://httpd.apache.org/docs/trunk/mod/core.html#errorlogformat
http://httpd.apache.org/docs/trunk/mod/core.html#loglevel

Cheers,
Stefan


Re: Apache logging

2010-09-12 Thread Sergio Junqueira
Do you need the first entry to determine which request may have caused httpd 
to 
crash or is there a different reason?

Mod_log_forensics writes the log record as soon as it is received. 
Mod_log_config writes the log record after the response is available. I don´t 
want to miss information about any request. Its  important to identify 
all incoming requests, no matter if they fail or succeed.

I would like to trace them having a small log record from the incoming 
requests. Useful to determine which request may have caused httpd to crash, as 
you  mentioned, and to have 100% guarantee that all incoming requests were 
logged before Apache started processing it.

Does mod_log_config always writes a log record for all incoming requests, no 
matter where or when they failed in the processing chain? If this is the case, 
mod_log_config provides the %D format to determine when the incoming request 
was 
received and it seems the current mod_log_config record would provide the 
information I need.

Thanks,
Sergio.




From: Stefan Fritsch @sfritsch.de
To: Sergio Junqueira @yahoo.com
Cc: dev@httpd.apache.org
Sent: Sun, September 12, 2010 7:18:07  AM
Subject: Re: Apache logging

On Fri, 10 Sep 2010, Sergio Junqueira wrote:

 I have a suggestion for the developers of Apache related to mod_log_config or
 mod_log_forensics:
 
 1) To allow mod_log_config to write the log file with a first log entry with
 basic information about the request before it's processed further (that is,
 after receiving the headers). The second log entry (the current logging 
format)
 would be written after the request processing. A log ID, just like the
 forensic ID, should be available on both entries.
 
 2)- Or to allow mod_log_forensic to be configured not to write all headers to
 disk. For instance, we should be able to configure it just like we do with
 LogFormat on mod_log_config. Or at least allow us to choose to write just the
 1st request line, without all the headers.

I think 2) would be a reasonable feature request for mod_log_forensic and  
would 
be easy to implement. However, I am interested about your actual use case. Do 
you need the first entry to determine which request may have caused httpd to 
crash or is there a different reason?


If you are generally interested in better logging in httpd, you may want to 
read 
and possibly comment about some new features in 2.3/2.4:

http://httpd.apache.org/docs/trunk/mod/core.html#errorlogformat
http://httpd.apache.org/docs/trunk/mod/core.html#loglevel

Cheers,
Stefan



  

RE: Apache logging

2010-09-12 Thread David Dabbs

I'm not sure it is related, but I'd like to know the most efficient way 
to debug error_log entries such as the following. In the first case, I 
presume that the referrer was absent or was unable to be read.
Ideally a conditional forensics log  (i.e. only on error response codes) 
would probably do it, but I don't think that's possible, right?


Thanks,

David


[Mon Sep 13 04:12:25 2010] [error] [client 71.225.73.189] request failed:
error reading the headers


[Mon Sep 13 04:25:22 2010] [error] [client 210.204.226.18] request failed:
error reading the headers, referer:
http://foo.com?dtm_com=28dtm_cmagic=d3b1fbdtm_fid=101dtm_format=5cli_pro
mo_id=1dtmc_ver=3dtm_cid=2366dtmc_u2=/categorydtmc_u3=26047dtmc_u4=null
dtmc_u5=nulldtmc_u9=gp%253Abrowse%253Ababy%253AToddler%2520Girl%2520%25281
-5%2520yrs%2529%253ASale%253ASweatersdtmc_u10=http%253A//blah.com/browse/ca
tegory.do%253Fcid%253D26047dtmc_transaction_id=1%3Fdtmc_type=090dtmc_cat=
037dtmc_ref=http%3A//blah.com/browse/category.do%3Fcid%3D26047dtmc_url=htt
p%3A//fls.doubleclick.net/activityi%3Bsrc%3D2840522%3Btype%3D090%3Bcat%3D037
%3Bqty%3D1%3Btran%3Dnull%3Bu%3DUSD%3Bu2%3D/category%3Bu3%3D26047%3Bu4%3Dnull
%3Bu5%3Dnull%3Bu9%3Dgp%253Abrowse%253A%253AToddler%2520Girl%2520%25281-5%252
0yrs%2529%253ASale%253ASweaters%3Bu10%3Dhttp%253A//blah.com/browse/category.
do%253Fcid%253D26047%3Bord%3D1%3F



From: Sergio Junqueira  
Sent: Sunday, September 12, 2010 8:35 PM
To: dev@httpd.apache.org
Subject: Re: Apache logging

Do you need the first entry to determine which request may have caused
httpd to crash or is there a different reason?

Mod_log_forensics writes the log record as soon as it is received.
Mod_log_config writes the log record after the response is available. I
don´t want to miss information about any request. Its important to identify
all incoming requests, no matter if they fail or succeed.

I would like to trace them having a small log record from the incoming
requests. Useful to determine which request may have caused httpd to crash,
as you mentioned, and to have 100% guarantee that all incoming requests were
logged before Apache started processing it.

Does mod_log_config always writes a log record for all incoming requests, no
matter where or when they failed in the processing chain? If this is the
case, mod_log_config provides the %D format to determine when
the incoming request was received and it seems the current mod_log_config
record would provide the information I need.

Thanks,
Sergio.


Cc: dev@httpd.apache.org
Sent: Sun, September 12, 2010 7:18:07 AM
Subject: Re: Apache logging

On Fri, 10 Sep 2010, Sergio Junqueira wrote:

 I have a suggestion for the developers of Apache related to mod_log_config
or
 mod_log_forensics:
 
 1) To allow mod_log_config to write the log file with a first log entry
with
 basic information about the request before it's processed further (that
is,
 after receiving the headers). The second log entry (the current logging
format)
 would be written after the request processing. A log ID, just like the
 forensic ID, should be available on both entries.
 
 2)- Or to allow mod_log_forensic to be configured not to write all headers
to
 disk. For instance, we should be able to configure it just like we do with
 LogFormat on mod_log_config. Or at least allow us to choose to write just
the
 1st request line, without all the headers.

I think 2) would be a reasonable feature request for mod_log_forensic and
would be easy to implement. However, I am interested about your actual use
case. Do you need the first entry to determine which request may have caused
httpd to crash or is there a different reason?


If you are generally interested in better logging in httpd, you may want to
read and possibly comment about some new features in 2.3/2.4:

http://httpd.apache.org/docs/trunk/mod/core.html#errorlogformat
http://httpd.apache.org/docs/trunk/mod/core.html#loglevel

Cheers,
Stefan





Apache logging

2010-09-10 Thread Sergio Junqueira
I have a suggestion for the developers of Apache related to mod_log_config or 
mod_log_forensics:

1) To allow mod_log_config to write the log file with a first log entry with 
basic information about the request before it's processed further (that is, 
after receiving the headers). The second log entry (the current logging format) 
would be written after the request processing. A log ID, just like the 
forensic ID, should be available on both entries.

2)- Or to allow mod_log_forensic to be configured not to write all headers to 
disk. For instance, we should be able to configure it just like we do with 
LogFormat on mod_log_config. Or at least allow us to choose to write just the 
1st request line, without all the headers.

Thanks.



  

Re: Apache logging in prev?

2009-04-16 Thread Bob Ionescu
2009/4/15 Michele Waldman mmwald...@nyc.rr.com:
 ./server/util_script.c
apr_table_addn(e, REMOTE_USER, r-user);
apr_table_addn(e, REDIRECT_REMOTE_USER, back-user);

 I could this.  Is this the right place?

That's for ENVs, but not the place where a module reads and sets the
user to r-user.

r-user is set this way in mod_auth_digest:

r-user = (char *) resp-username;

resp-username is a result of parsing the HTTP request headers:
if (!strcasecmp(key, username))
resp-username = apr_pstrdup(r-pool, value);

Bob


Apache logging in prev?

2009-04-15 Thread Michele Waldman
In auth_mod_digest, it looks for previous authentication:

 

while (mainreq-prev != NULL) {

mainreq = mainreq-prev;

}

 

I'm trying to prevent this in certain cases to allow a new login.

 

If I stop this statement, it uses the new creditials to validate, but this
user is not being logged in.

 

Does anyone know where the code that actually sets the remote user, etc is?

 

I think it may have the prev loop there, too.  I'm not sure but I'd like to
take a look.

 

Thanks,

 

Michele

 



RE: Apache logging in prev?

2009-04-15 Thread Michele Waldman
./server/util_script.c
apr_table_addn(e, REMOTE_USER, r-user);
apr_table_addn(e, REDIRECT_REMOTE_USER, back-user);

I could this.  Is this the right place?

Michele

 -Original Message-
 From: Michele Waldman [mailto:mmwald...@nyc.rr.com]
 Sent: Wednesday, April 15, 2009 3:13 PM
 To: modules-dev@httpd.apache.org
 Subject: Apache logging in prev?
 
 In auth_mod_digest, it looks for previous authentication:
 
 
 
 while (mainreq-prev != NULL) {
 
 mainreq = mainreq-prev;
 
 }
 
 
 
 I'm trying to prevent this in certain cases to allow a new login.
 
 
 
 If I stop this statement, it uses the new creditials to validate, but this
 user is not being logged in.
 
 
 
 Does anyone know where the code that actually sets the remote user, etc
 is?
 
 
 
 I think it may have the prev loop there, too.  I'm not sure but I'd like
 to
 take a look.
 
 
 
 Thanks,
 
 
 
 Michele