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 11:58:57 GMT


mod_log_config is "pluggable."   You can "replace" the normal logging 
functions quite easily.


Just do something like:


static apr_status_t my_logger_writer(request_rec *r,
                                            void *handle,
                                       const char **strs,
                                       int *strl,
                                       int nelts,
                                       apr_size_t len)

{
...

}

static void *my_logger_init(apr_pool_t *p, server_rec *s,
                                         const char* path)
{
/*return a log "handle"*/
}

static void register_hooks(apr_pool_t * p)
{

     set_writer_init = APR_RETRIEVE_OPTIONAL_FN(ap_log_set_writer_init);
     set_writer = APR_RETRIEVE_OPTIONAL_FN(ap_log_set_writer);


     set_writer_init(my_logger_init);
     set_writer(my_logger_writer);

}



-- 
Brian Akins
Lead Systems Engineer
CNN Internet Technologies

Mime
View raw message