Hi, Tom,

Your read the code too fast :-P
Yes, it's "#ifndef", which means if you do NOT define DEBUG, you will go
inside the block and return. :-)
So it only logs when you define the DEBUG.

My first reaction is exactly as you suggested, trying to tune the LogLevel.
But it does NOT help, i.e., whatever log level you set, the message won't
be printed.

Look at the code, level_and_mask is from the hard-coded APLOG_INFO, and
ap_default_loglevel is also pre-set and has nothing to do with LogLevel.

I hope what I said makes sense to you.

Best,
T






On Thu, Dec 6, 2012 at 1:48 AM, Tom Evans <tevans...@googlemail.com> wrote:

> On Thu, Dec 6, 2012 at 8:02 AM, Tianyin Xu <t...@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-unsubscr...@httpd.apache.org
> For additional commands, e-mail: users-h...@httpd.apache.org
>
>


-- 
Tianyin XU,
http://cseweb.ucsd.edu/~tixu/

Reply via email to