]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
Add a new request phase, for allowing management modules to forward
authorRyan Bloom <rbb@apache.org>
Wed, 6 Jun 2001 22:24:54 +0000 (22:24 +0000)
committerRyan Bloom <rbb@apache.org>
Wed, 6 Jun 2001 22:24:54 +0000 (22:24 +0000)
error logs to their management agents.

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89281 13f79535-47bb-0310-9956-ffa450edef68

CHANGES
include/http_log.h
server/log.c

diff --git a/CHANGES b/CHANGES
index 1f060b87ab73437b2f713ed80a4eb112556f1e99..bf148b6af133fb669a9da79a41b6131811a1ae0d 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,5 +1,11 @@
 Changes with Apache 2.0.19-dev
 
+  *) Add a new request hook, error_log.  This phase allows modules
+     to act on the error log string _after_ it has been written
+     to the error log.  The goal for this hook is to allow monitoring
+     modules to send the error string to the monitoring agent.
+     [Ryan Bloom]
+
   *) Modify mod_echo to make it use filters for input and output.
      [Ryan Morgan <rmorgan@covalent.net>]
 
index 71d50a3e502ec8af8cfc99c5e01b2686e63ab50a..1b39029911c2b255185bc7d7beb7aa7bc7cef4db 100644 (file)
@@ -275,6 +275,11 @@ AP_DECLARE(void) ap_close_piped_log(piped_log *pl);
  */
 #define ap_piped_log_write_fd(pl)      ((pl)->fds[1])
 
+AP_DECLARE_HOOK(void, error_log, (const char *file, int line, int level,
+                       apr_status_t status, const server_rec *s,
+                       const request_rec *r, apr_pool_t *pool,
+                       const char *errstr))
+
 #ifdef __cplusplus
 }
 #endif
index a73abb0234714ec9dca51c5846fb997232f1d68a..d634b8ef807ad5a7d9d64203cf8f0354647c998a 100644 (file)
@@ -96,6 +96,10 @@ typedef struct {
        int     t_val;
 } TRANS;
 
+APR_HOOK_STRUCT(
+    APR_HOOK_LINK(error_log)
+)
+
 #ifdef HAVE_SYSLOG
 
 static const TRANS facilities[] = {
@@ -455,6 +459,7 @@ static void log_error_core(const char *file, int line, int level,
        syslog(level_and_mask, "%s", errstr);
     }
 #endif
+    ap_run_error_log(file, line, level, status, s, r, pool, errstr);
 }
     
 AP_DECLARE(void) ap_log_error(const char *file, int line, int level,
@@ -750,3 +755,10 @@ AP_DECLARE(void) ap_close_piped_log(piped_log *pl)
     apr_pool_cleanup_run(pl->p, pl, piped_log_cleanup);
 }
 
+AP_IMPLEMENT_HOOK_VOID(error_log,
+                       (const char *file, int line, int level, 
+                       apr_status_t status, const server_rec *s,
+                       const request_rec *r, apr_pool_t *pool, 
+                       const char *errstr), (file, line, level,
+                       status, s, r, pool, errstr))
+