Main Page | Modules | Namespace List | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals | Related Pages | Examples

mod_log_config.h

Go to the documentation of this file.
00001 /* Copyright 2001-2005 The Apache Software Foundation or its licensors, as
00002  * applicable.
00003  *
00004  * Licensed under the Apache License, Version 2.0 (the "License");
00005  * you may not use this file except in compliance with the License.
00006  * You may obtain a copy of the License at
00007  *
00008  *     http://www.apache.org/licenses/LICENSE-2.0
00009  *
00010  * Unless required by applicable law or agreed to in writing, software
00011  * distributed under the License is distributed on an "AS IS" BASIS,
00012  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00013  * See the License for the specific language governing permissions and
00014  * limitations under the License.
00015  */
00016 
00017 #include "apr_optional.h"
00018 #include "httpd.h"
00019 #include "scoreboard.h"
00020 
00021 #ifndef _MOD_LOG_CONFIG_H
00022 #define _MOD_LOG_CONFIG_H 1
00023 
00024 /** 
00025  * callback function prototype for a external log handler
00026  */
00027 typedef const char *ap_log_handler_fn_t(request_rec *r, char *a);
00028 
00029 /**
00030  * callback function prototype for a external writer initilization.
00031  */
00032 typedef void *ap_log_writer_init(apr_pool_t *p, server_rec *s, 
00033                                  const char *name);
00034 /**
00035  * callback which gets called where there is a log line to write.
00036  */
00037 typedef apr_status_t ap_log_writer(
00038                             request_rec *r,
00039                             void *handle, 
00040                             const char **portions,
00041                             int *lengths,
00042                             int nelts,
00043                             apr_size_t len);
00044 
00045 typedef struct ap_log_handler {
00046     ap_log_handler_fn_t *func;
00047     int want_orig_default;
00048 } ap_log_handler;
00049 
00050 APR_DECLARE_OPTIONAL_FN(void, ap_register_log_handler, 
00051                         (apr_pool_t *p, char *tag, ap_log_handler_fn_t *func,
00052                          int def));
00053 /**
00054  * you will need to set your init handler *BEFORE* the open_logs 
00055  * in mod_log_config gets executed
00056  */
00057 APR_DECLARE_OPTIONAL_FN(void, ap_log_set_writer_init,(ap_log_writer_init *func));
00058 /** 
00059  * you should probably set the writer at the same time (ie..before open_logs)
00060  */
00061 APR_DECLARE_OPTIONAL_FN(void, ap_log_set_writer, (ap_log_writer* func));
00062 
00063 #endif /* MOD_LOG_CONFIG */