/usr/src/redhat/BUILD/httpd-2.2.3/include/http_log.h

説明を見る。
00001 /* Licensed to the Apache Software Foundation (ASF) under one or more
00002  * contributor license agreements.  See the NOTICE file distributed with
00003  * this work for additional information regarding copyright ownership.
00004  * The ASF licenses this file to You under the Apache License, Version 2.0
00005  * (the "License"); you may not use this file except in compliance with
00006  * the License.  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 
00026 #ifndef APACHE_HTTP_LOG_H
00027 #define APACHE_HTTP_LOG_H
00028 
00029 #ifdef __cplusplus
00030 extern "C" {
00031 #endif
00032 
00033 #include "apr_thread_proc.h"
00034 
00035 #ifdef HAVE_SYSLOG
00036 #include <syslog.h>
00037 
00038 #ifndef LOG_PRIMASK
00039 #define LOG_PRIMASK 7
00040 #endif
00041 
00042 #define APLOG_EMERG     LOG_EMERG     /* system is unusable */
00043 #define APLOG_ALERT     LOG_ALERT     /* action must be taken immediately */
00044 #define APLOG_CRIT      LOG_CRIT      /* critical conditions */
00045 #define APLOG_ERR       LOG_ERR       /* error conditions */
00046 #define APLOG_WARNING   LOG_WARNING   /* warning conditions */
00047 #define APLOG_NOTICE    LOG_NOTICE    /* normal but significant condition */
00048 #define APLOG_INFO      LOG_INFO      /* informational */
00049 #define APLOG_DEBUG     LOG_DEBUG     /* debug-level messages */
00050 
00051 #define APLOG_LEVELMASK LOG_PRIMASK   /* mask off the level value */
00052 
00053 #else
00054 
00055 #define APLOG_EMERG     0       /* system is unusable */
00056 #define APLOG_ALERT     1       /* action must be taken immediately */
00057 #define APLOG_CRIT      2       /* critical conditions */
00058 #define APLOG_ERR       3       /* error conditions */
00059 #define APLOG_WARNING   4       /* warning conditions */
00060 #define APLOG_NOTICE    5       /* normal but significant condition */
00061 #define APLOG_INFO      6       /* informational */
00062 #define APLOG_DEBUG     7       /* debug-level messages */
00063 
00064 #define APLOG_LEVELMASK 7       /* mask off the level value */
00065 
00066 #endif
00067 
00068 /* APLOG_NOERRNO is ignored and should not be used.  It will be
00069  * removed in a future release of Apache.
00070  */
00071 #define APLOG_NOERRNO           (APLOG_LEVELMASK + 1)
00072 
00073 /* Use APLOG_TOCLIENT on ap_log_rerror() to give content
00074  * handlers the option of including the error text in the 
00075  * ErrorDocument sent back to the client. Setting APLOG_TOCLIENT
00076  * will cause the error text to be saved in the request_rec->notes 
00077  * table, keyed to the string "error-notes", if and only if:
00078  * - the severity level of the message is APLOG_WARNING or greater
00079  * - there are no other "error-notes" set in request_rec->notes
00080  * Once error-notes is set, it is up to the content handler to
00081  * determine whether this text should be sent back to the client.
00082  * Note: Client generated text streams sent back to the client MUST 
00083  * be escaped to prevent CSS attacks.
00084  */
00085 #define APLOG_TOCLIENT          ((APLOG_LEVELMASK + 1) * 2)
00086 
00087 /* normal but significant condition on startup, usually printed to stderr */
00088 #define APLOG_STARTUP           ((APLOG_LEVELMASK + 1) * 4) 
00089 
00090 #ifndef DEFAULT_LOGLEVEL
00091 #define DEFAULT_LOGLEVEL        APLOG_WARNING
00092 #endif
00093 
00094 extern int AP_DECLARE_DATA ap_default_loglevel;
00095 
00096 #define APLOG_MARK      __FILE__,__LINE__
00097 
00102 AP_DECLARE(void) ap_open_stderr_log(apr_pool_t *p);
00103 
00109 AP_DECLARE(apr_status_t) ap_replace_stderr_log(apr_pool_t *p, 
00110                                                const char *file);
00111 
00121 int ap_open_logs(apr_pool_t *pconf, apr_pool_t *plog, 
00122                  apr_pool_t *ptemp, server_rec *s_main);
00123 
00124 #ifdef CORE_PRIVATE
00125 
00134 void ap_logs_child_init(apr_pool_t *p, server_rec *s);
00135 
00136 #endif /* CORE_PRIVATE */
00137 
00138 /* 
00139  * The primary logging functions, ap_log_error, ap_log_rerror, ap_log_cerror,
00140  * and ap_log_perror use a printf style format string to build the log message.  
00141  * It is VERY IMPORTANT that you not include any raw data from the network, 
00142  * such as the request-URI or request header fields, within the format 
00143  * string.  Doing so makes the server vulnerable to a denial-of-service 
00144  * attack and other messy behavior.  Instead, use a simple format string 
00145  * like "%s", followed by the string containing the untrusted data.
00146  */
00147 
00171 AP_DECLARE(void) ap_log_error(const char *file, int line, int level, 
00172                              apr_status_t status, const server_rec *s, 
00173                              const char *fmt, ...)
00174                             __attribute__((format(printf,6,7)));
00175 
00195 AP_DECLARE(void) ap_log_perror(const char *file, int line, int level, 
00196                              apr_status_t status, apr_pool_t *p, 
00197                              const char *fmt, ...)
00198                             __attribute__((format(printf,6,7)));
00199 
00219 AP_DECLARE(void) ap_log_rerror(const char *file, int line, int level, 
00220                                apr_status_t status, const request_rec *r, 
00221                                const char *fmt, ...)
00222                             __attribute__((format(printf,6,7)));
00223 
00245 AP_DECLARE(void) ap_log_cerror(const char *file, int line, int level, 
00246                                apr_status_t status, const conn_rec *c, 
00247                                const char *fmt, ...)
00248                             __attribute__((format(printf,6,7)));
00249 
00254 AP_DECLARE(void) ap_error_log2stderr(server_rec *s);
00255 
00261 AP_DECLARE(void) ap_log_pid(apr_pool_t *p, const char *fname);
00262 
00269 AP_DECLARE(apr_status_t) ap_read_pid(apr_pool_t *p, const char *filename, pid_t *mypid);
00270 
00272 typedef struct piped_log piped_log;
00273 
00280 struct piped_log {
00282     apr_pool_t *p;
00284     apr_file_t *fds[2];
00285     /* XXX - an #ifdef that needs to be eliminated from public view. Shouldn't
00286      * be hard */
00287 #ifdef AP_HAVE_RELIABLE_PIPED_LOGS
00288 
00289     char *program;
00291     apr_proc_t *pid;
00292 #endif
00293 };
00294 
00301 AP_DECLARE(piped_log *) ap_open_piped_log(apr_pool_t *p, const char *program);
00302 
00307 AP_DECLARE(void) ap_close_piped_log(piped_log *pl);
00308 
00314 #define ap_piped_log_read_fd(pl)        ((pl)->fds[0])
00315 
00321 #define ap_piped_log_write_fd(pl)       ((pl)->fds[1])
00322 
00335 AP_DECLARE_HOOK(void, error_log, (const char *file, int line, int level,
00336                        apr_status_t status, const server_rec *s,
00337                        const request_rec *r, apr_pool_t *pool,
00338                        const char *errstr))
00339 
00340 #ifdef __cplusplus
00341 }
00342 #endif
00343 
00344 #endif  /* !APACHE_HTTP_LOG_H */
00345 

Apacheに対してSun Jul 19 22:05:23 2009に生成されました。  doxygen 1.4.7