httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sander Temme <>
Subject Re: [users@httpd] Where is access.log generated
Date Wed, 03 Jan 2007 00:52:28 GMT

On Jan 2, 2007, at 4:13 PM, Arthur Kreitman wrote:

> I can’t find where the writes to access.log are called?  Any hints?

Looking through the Apache source code, the access log entries are  
generated by the ap_hook_log_transaction hook, which is implemented  
by modules/loggers/mod_log_config.c and ran from several possible  
places in server/protocol.c (and server/eor_bucket.c). I dearly hope  
only one of those code paths actually gets followed during a given  
transaction. (:

If you have your own module, you can implement  
ap_hook_log_transaction and add to the access log yourself.

Yes, hooks can be somewhat untraceable in Apache, but in the Apache  
source distribution, all hooks (save one) that are defined are  
actually called. The pattern is:

* To declare a hook handler, you call ap_hook_mumble from your
   register_hooks function implementation
* To run the hook, Apache calls ap_run_mumble.

So, to find out about logging, I used find and grep:

[sctemme@graymalkin] trunk $ find . -type f -name \*.c | xargs grep  
[sctemme@graymalkin] trunk $ find . -type f -name \*.c | xargs grep  

(output omitted but easily obtained).


PGP FP: 51B4 8727 466A 0BC3 69F4  B7B8 B2BE BC40 1529 24AF

View raw message