httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brian Akins <brian.ak...@turner.com>
Subject Re: Pluggable mod_log_config
Date Mon, 03 Oct 2005 14:26:17 GMT
Ondrej Sury wrote:

> 
> Nope, (void *)cls->log_writer is pointer to log file descriptor.

this can be anything. (it's a void).  In some modules I have written, 
it's a wrapper around a socket. See, open_config_log

cls->log_writer = log_writer_init(p, s, cls->fname);

log_writer_init retures whatever you function returns.  In 
mod_log_config, it's an apr_file_t *.

Currently, however, log_writer_init is global.  It should be per cls, or 
per server.


> 
>>Also, init is called for each CustomLog config entry.
> 
> 
> Yep, but only ap_log_writer_init is called.  You need to do something
> like that:
> 
> foreach provider in ap_log_writer_providers {
> 	cls->log_writer = provider->init(...., &cls->log_data);
> 
> 	if (cls->log_writer) {
> 		break;
> 	}
> }
> 
> Then later when writing log you need to call
> 
> cls->log_writer(..., cls->log_data, ...)
> 
> instead of just
> 
> log_writer(...)

yes. basically.

I figure you could change cls to:

typedef struct {
     const char *fname;
     const char *format_string;
     apr_array_header_t *format;
     void *log_writer;
     void *log_init; /*added*/
     char *condition_var;
} config_log_state;


and log_init and log_writer would be set at config time.  log_init would 
get ran in open_logs.


-- 
Brian Akins
Lead Systems Engineer
CNN Internet Technologies

Mime
View raw message