summaryrefslogtreecommitdiffstats
path: root/include/http_core.h
diff options
context:
space:
mode:
authorStefan Fritsch <sf@apache.org>2011-11-21 18:36:26 +0100
committerStefan Fritsch <sf@apache.org>2011-11-21 18:36:26 +0100
commite0184da329410a868800ca4cf36b06cd40335fbe (patch)
treea6b544db881b42d30369273a55ebc753cb7d9a45 /include/http_core.h
parentmod_cache_disk: Make sure we check return codes on all writes and attempts (diff)
downloadapache2-e0184da329410a868800ca4cf36b06cd40335fbe.tar.xz
apache2-e0184da329410a868800ca4cf36b06cd40335fbe.zip
Pass ap_errorlog_info to error_log hook.
git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1204614 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'include/http_core.h')
-rw-r--r--include/http_core.h20
1 files changed, 18 insertions, 2 deletions
diff --git a/include/http_core.h b/include/http_core.h
index a6be6fb883..0bac928286 100644
--- a/include/http_core.h
+++ b/include/http_core.h
@@ -776,14 +776,17 @@ typedef struct ap_errorlog_info {
/** r->main if r is a subrequest, otherwise equal to r */
const request_rec *rmain;
- /** name of source file where the log message was produced. */
+ /** pool passed to ap_log_perror, NULL otherwise */
+ apr_pool_t *pool;
+
+ /** name of source file where the log message was produced, NULL if N/A. */
const char *file;
/** line number in the source file, 0 if N/A */
int line;
/** module index of module that produced the log message, APLOG_NO_MODULE if N/A. */
int module_index;
- /** log level of error message, -1 if N/A */
+ /** log level of error message (flags like APLOG_STARTUP have been removed), -1 if N/A */
int level;
/** apr error status related to the log message, 0 if no error */
@@ -844,6 +847,19 @@ typedef struct {
unsigned int min_loglevel;
} ap_errorlog_format_item;
+/**
+ * hook method to log error messages
+ * @ingroup hooks
+ * @param info pointer to ap_errorlog_info struct which contains all
+ * the details
+ * @param errstr message to log (unmodified
+ * @warning Allocating from the usual pools (pool, info->c->pool, info->p->pool)
+ * must be avoided because it can cause memory leaks.
+ * Use a subpool if necessary.
+ */
+AP_DECLARE_HOOK(void, error_log, (const ap_errorlog_info *info,
+ const char *errstr))
+
AP_CORE_DECLARE(void) ap_register_log_hooks(apr_pool_t *p);
AP_CORE_DECLARE(void) ap_register_config_hooks(apr_pool_t *p);