Commit e70bea7d authored by Stefan Fritsch's avatar Stefan Fritsch
Browse files

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
parent 30698963
Loading
Loading
Loading
Loading
+1 −1
Changes for CHANGES: 1 added line, 1 removed line.
Original line number Diff line number Diff line
                                                         -*- coding: utf-8 -*-
Changes with Apache 2.5.0

  *) error log hook: add conn_rec as a parameter.  [Jeff Trawick]
  *) error log hook: Pass ap_errorlog_info struct.  [Stefan Fritsch]

  [Apache 2.5.0-dev includes those bug fixes and changes with the
   Apache 2.4.xx tree as documented below, except as noted.]
+2 −0
Changes for docs/manual/developer/new_api_2_4.xml: 2 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -127,6 +127,8 @@
      <li>New function ap_get_server_name_for_url to support ipv6 literals.</li>
      <li>New function ap_register_errorlog_handler to register errorlog
          format string handlers.</li>
      <li>Arguments of error_log hook have changed. Declaration has moved to
          <code>http_core.h</code>.</li>
      <li>New function ap_state_query to determine if the server is in the
          initial configuration preflight phase or not. This is both easier to
          use and more correct than the old method of creating a pool userdata
+3 −1
Changes for include/ap_mmn.h: 3 added lines, 1 removed line.
Original line number Diff line number Diff line
@@ -368,12 +368,14 @@
 * 20111118.0 (2.5.0-dev)  Add conn_rec to error_log hook
 * 20111118.1 (2.5.0-dev)  Add reclvl to ap_expr_eval_ctx_t
 * 20111120.0 (2.5.0-dev)  Remove parts of conn_state_t that are private to the MPM
 * 20111121.0 (2.5.0-dev)  Pass ap_errorlog_info struct to error_log hook,
 *                         add pool to ap_errorlog_info.
 */

#define MODULE_MAGIC_COOKIE 0x41503234UL /* "AP24" */

#ifndef MODULE_MAGIC_NUMBER_MAJOR
#define MODULE_MAGIC_NUMBER_MAJOR 20111120
#define MODULE_MAGIC_NUMBER_MAJOR 20111121
#endif
#define MODULE_MAGIC_NUMBER_MINOR 0                   /* 0...n */

+18 −2
Changes for include/http_core.h: 18 added lines, 2 removed lines.
Original line number Diff line number Diff line
@@ -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);

+0 −20
Changes for include/http_log.h: 0 added lines, 20 removed lines.
Original line number Diff line number Diff line
@@ -624,26 +624,6 @@ AP_DECLARE(apr_file_t *) ap_piped_log_read_fd(piped_log *pl);
 */
AP_DECLARE(apr_file_t *) ap_piped_log_write_fd(piped_log *pl);

/**
 * hook method to log error messages
 * @ingroup hooks
 * @param file The file in which this function is called
 * @param line The line number on which this function is called
 * @param module_index The module_index of the module generating this message
 * @param level The level of this error message
 * @param status The status code from the previous command
 * @param s The server which we are logging for
 * @param c The connection which we are logging for
 * @param r The request which we are logging for
 * @param pool Memory pool to allocate from
 * @param errstr message to log
 */
AP_DECLARE_HOOK(void, error_log, (const char *file, int line,
                       int module_index, int level,
                       apr_status_t status, const server_rec *s,
                       const conn_rec *c, const request_rec *r,
                       apr_pool_t *pool, const char *errstr))

/**
 * hook method to generate unique id for connection or request
 * @ingroup hooks
Loading