Commit da4e6658 authored by Ryan Bloom's avatar Ryan Bloom
Browse files

Add a new request phase, for allowing management modules to forward

error logs to their management agents.


git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@89281 13f79535-47bb-0310-9956-ffa450edef68
parent d788dd0c
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
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>]

+5 −0
Original line number Diff line number Diff line
@@ -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
+12 −0
Original line number Diff line number Diff line
@@ -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))