summaryrefslogtreecommitdiff
path: root/include/http_log.h
diff options
context:
space:
mode:
authorJeff Trawick <trawick@apache.org>2004-10-29 14:45:24 +0000
committerJeff Trawick <trawick@apache.org>2004-10-29 14:45:24 +0000
commit81e4e36b0eace2dd1e4717831cb751ac77e3f1d9 (patch)
tree5296e4adc4835d7557889e4534b80c5f9ef2d7f1 /include/http_log.h
parenta5278a9c0b8bdf863c26315bf7090b22a1119ef1 (diff)
downloadhttpd-81e4e36b0eace2dd1e4717831cb751ac77e3f1d9.tar.gz
add ap_log_cerror(); use it in a couple of places in core output filter
so that the client IP address is recorded in the log git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@105625 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'include/http_log.h')
-rw-r--r--include/http_log.h52
1 files changed, 43 insertions, 9 deletions
diff --git a/include/http_log.h b/include/http_log.h
index 8f20928ead..f358211cb5 100644
--- a/include/http_log.h
+++ b/include/http_log.h
@@ -116,8 +116,8 @@ int ap_open_logs(apr_pool_t *pconf, apr_pool_t *plog,
apr_pool_t *ptemp, server_rec *s_main);
/*
- * The three primary logging functions, ap_log_error, ap_log_rerror, and
- * ap_log_perror use a printf style format string to build the log message.
+ * The primary logging functions, ap_log_error, ap_log_rerror, ap_log_cerror,
+ * and ap_log_perror use a printf style format string to build the log message.
* It is VERY IMPORTANT that you not include any raw data from the network,
* such as the request-URI or request header fields, within the format
* string. Doing so makes the server vulnerable to a denial-of-service
@@ -126,8 +126,9 @@ int ap_open_logs(apr_pool_t *pconf, apr_pool_t *plog,
*/
/**
- * One of the primary logging routines in Apache. This uses a printf-like
- * format to log messages to the error_log.
+ * ap_log_error() - log messages which are not related to a particular
+ * request or connection. This uses a printf-like format to log messages
+ * to the error_log.
* @param file The file in which this function is called
* @param line The line number on which this function is called
* @param level The level of this error message
@@ -136,6 +137,10 @@ int ap_open_logs(apr_pool_t *pconf, apr_pool_t *plog,
* @param fmt The format string
* @param ... The arguments to use to fill out fmt.
* @tip Use APLOG_MARK to fill out file and line
+ * @tip If a request_rec is available, use that with ap_log_rerror()
+ * in preference to calling this function. Otherwise, if a conn_rec is
+ * available, use that with ap_log_cerror() in preference to calling
+ * this function.
* @warning It is VERY IMPORTANT that you not include any raw data from
* the network, such as the request-URI or request header fields, within
* the format string. Doing so makes the server vulnerable to a
@@ -150,8 +155,9 @@ AP_DECLARE(void) ap_log_error(const char *file, int line, int level,
__attribute__((format(printf,6,7)));
/**
- * The second of the primary logging routines in Apache. This uses
- * a printf-like format to log messages to the error_log.
+ * ap_log_perror() - log messages which are not related to a particular
+ * request, connection, or virtual server. This uses a printf-like
+ * format to log messages to the error_log.
* @param file The file in which this function is called
* @param line The line number on which this function is called
* @param level The level of this error message
@@ -174,13 +180,14 @@ AP_DECLARE(void) ap_log_perror(const char *file, int line, int level,
__attribute__((format(printf,6,7)));
/**
- * The last of the primary logging routines in Apache. This uses
- * a printf-like format to log messages to the error_log.
+ * ap_log_rerror() - log messages which are related to a particular
+ * request. This uses a a printf-like format to log messages to the
+ * error_log.
* @param file The file in which this function is called
* @param line The line number on which this function is called
* @param level The level of this error message
* @param status The status code from the previous command
- * @param s The request which we are logging for
+ * @param r The request which we are logging for
* @param fmt The format string
* @param ... The arguments to use to fill out fmt.
* @tip Use APLOG_MARK to fill out file and line
@@ -198,6 +205,33 @@ AP_DECLARE(void) ap_log_rerror(const char *file, int line, int level,
__attribute__((format(printf,6,7)));
/**
+ * ap_log_cerror() - log messages which are related to a particular
+ * connection. This uses a a printf-like format to log messages to the
+ * error_log.
+ * @param file The file in which this function is called
+ * @param line The line number on which this function is called
+ * @param level The level of this error message
+ * @param status The status code from the previous command
+ * @param c The connection which we are logging for
+ * @param fmt The format string
+ * @param ... The arguments to use to fill out fmt.
+ * @tip Use APLOG_MARK to fill out file and line
+ * @tip If a request_rec is available, use that with ap_log_rerror()
+ * in preference to calling this function.
+ * @warning It is VERY IMPORTANT that you not include any raw data from
+ * the network, such as the request-URI or request header fields, within
+ * the format string. Doing so makes the server vulnerable to a
+ * denial-of-service attack and other messy behavior. Instead, use a
+ * simple format string like "%s", followed by the string containing the
+ * untrusted data.
+ * @deffunc void ap_log_cerror(const char *file, int line, int level, apr_status_t status, conn_rec *c, const char *fmt, ...)
+ */
+AP_DECLARE(void) ap_log_cerror(const char *file, int line, int level,
+ apr_status_t status, const conn_rec *c,
+ const char *fmt, ...)
+ __attribute__((format(printf,6,7)));
+
+/**
* Convert stderr to the error log
* @param s The current server
* @deffunc void ap_error_log2stderr(server_rec *s)