[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#714613: ap_log_perror ignores LogLevel configuration directives



Source: apache2
Version: 2.4.4-6
Severity: normal
Tags: upstream

Hi,

This problem bit me while I was trying to debug merging configurations 
within an apache module. The interface you get is:

void *merge_dir_config(apr_pool_t *p, void* base, void *new)

so the only logging function you can use is ap_log_perror. Internally, 
that calls log_error_core with NULL s, c, r arguments (server_rec, 
conn_rec, request_rec); log_error_core has the following code:

    if (s == NULL) {
        /*
         * If we are doing stderr logging (startup), don't log messages that are
         * above the default server log level unless it is a startup/shutdown
         * notice
         */
        if ((level_and_mask != APLOG_NOTICE)
            && (level_and_mask > ap_default_loglevel)) {
            return;
        }

        logf = stderr_log;
    }

....which means that however you configure LogLevel, ap_log_perror won't 
result in anything being logged unless you set the level to <= 
ap_default_loglevel (which is APLOG_WARNING).

Since this is the only way to log the behaviour of config-merging code 
(which you'd naturally want to log at DEBUG or similar), I think this is 
a bug.

This bug exists in both the stable (2.2 series) and unstable (2.4) 
series of Apache.

Regards,

Matthew

-- Package-specific info:
List of enabled modules from 'apache2 -M':
  alias auth_basic authn_file authz_default authz_groupfile
  authz_host authz_user autoindex cgi deflate dir env filter mime
  negotiation reqtimeout setenvif status ucam_webauth userdir

-- System Information:
Debian Release: 7.1
  APT prefers stable-updates
  APT policy: (500, 'stable-updates'), (500, 'stable'), (1, 'experimental')
Architecture: amd64 (x86_64)

Kernel: Linux 3.2.0-4-amd64 (SMP w/8 CPU cores)
Locale: LANG=en_GB.UTF-8, LC_CTYPE=en_GB.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages apache2-mpm-prefork depends on:
ii  apache2.2-bin     2.2.22-13
ii  apache2.2-common  2.2.22-13

apache2-mpm-prefork recommends no packages.

apache2-mpm-prefork suggests no packages.

-- no debconf information


Reply to: