diff options
author | Stefan Fritsch <sf@apache.org> | 2011-11-21 18:36:26 +0100 |
---|---|---|
committer | Stefan Fritsch <sf@apache.org> | 2011-11-21 18:36:26 +0100 |
commit | e0184da329410a868800ca4cf36b06cd40335fbe (patch) | |
tree | a6b544db881b42d30369273a55ebc753cb7d9a45 /include/http_core.h | |
parent | mod_cache_disk: Make sure we check return codes on all writes and attempts (diff) | |
download | apache2-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.h | 20 |
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); |