httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Fritsch>
Subject Re: Per-module loglevel configuration
Date Fri, 19 Mar 2010 15:46:04 GMT
On Friday 19 March 2010, Jeff Trawick wrote:
> Any thoughts about allowing the conn_rec to hold a logging config
> structure which would be consulted when the conn_rec is available,
>  in order to allow different logging levels per client (whether
>  implemented by core or by another module)?
> It could be very helpful to enable the most verbose logging in a
> production system only for a certain debug/administrative
>  client.  (In general, this setup would allow a module to implement
>  all sorts of log level adjustments in a pre-connection hook.)

I had thought to do this with per-dir logging and <If %{REMOTE_CLIENT} 
...> blocks, which could be then used to set the loglevel per-client. 
But this would only affect ap_log_rerror. Adding a loging config 
structure to the connr_rec would also affect ap_log_cerror and would 
allow to set the debug logging earlier. Therefore I think it is a very 
good idea.

> Perhaps satisfying per-directory log level and per-client log level
> requirements aren't really that different.  (Look in r->logcfg then
> c->logcfg then s->logcfg to find the logging config.)

Sure. The larger part of the work is the configuration and config 
merging code. But even without that, it may make sense to have the 
infrastructure available for other modules to set the log level per 
request or per connection. One could e.g. imagine to have a 
mod_rewrite flag that sets the loglevel similar to the E flag for 
setting an envvar.

Of course, it would be even better to have the full per-dir 
configuration code finished in 2.4, but ATM I don't have enough free 

View raw message