httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tom Evans <tevans...@googlemail.com>
Subject Re: [users@httpd] In what condition, can this log message be printed?
Date Thu, 06 Dec 2012 09:48:28 GMT
On Thu, Dec 6, 2012 at 8:02 AM, Tianyin Xu <tixu@cs.ucsd.edu> wrote:
> Hi, Eric,
>
> I'm sorry for the disturbing for this problem.
>
> I used GDB to trace the code, in the hope of understanding why httpd never
> print that log message.
>
> Basically, that following code print out the log message:
>
> /* server/mpm/event/event.c */
> 3182         ap_log_error(APLOG_MARK, APLOG_INFO, 0, NULL, APLOGNO(00521)
> 3183                      "MaxClients is deprecated, use MaxRequestWorkers "
> 3184                      "instead.");
>
> and at the startup, the system did execute this logging statement.
>
> but when go inside the ap_log_error function, it fails into the following if
> condition:
>
> /* server/log.c */
> 1120         /*
> 1121          * If we are doing stderr logging (startup), don't log messages
> that are
> 1122          * above the default server log level unless it is a
> startup/shutdown
> 1123          * notice
> 1124          */
> 1125 #ifndef DEBUG
> 1126         if ((level_and_mask != APLOG_NOTICE)
> 1127             && (level_and_mask > ap_default_loglevel)) {
> 1128             return;
> 1129         }
> 1130 #endif
>
> Here, level_and_mask is 6 (APLOG_INFO), and ap_default_loglevel is 4. So the
> code simply returned without printing the log message, and that's why I
> never had chance to see the log message.
>
> I have the following two questions:
>
> 1. How to enable the DEBUG macro in this case?

Re-read the code - it is in an "#ifndef" block - if NOT defined. That
block is compiled when DEBUG is NOT set.

> 2. Is this behavior on purpose? because I think most httpd are not enabled
> with DEBUG, so this kind of information is hardly to be noticed.

The reason you don't see the message is that the message is at log
level info, but you have configured httpd to only emit messages at log
level warn or higher.


Cheers

Tom

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Mime
View raw message