logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mak, Howard" <h...@vaultus.com>
Subject Re: logger w/o any appender
Date Tue, 18 Dec 2007 14:56:00 GMT
Thanks for the clarification.

I suppose that if I wanted to disable a logger [when rootLogger has an appender], then I should
point my OFF-level logger to a NullAppender?

- Howard


----- Original Message -----
From: Blok, Eelke <eelke.blok@numico.com>
To: Log4J Users List <log4j-user@logging.apache.org>
Sent: Tue Dec 18 03:19:00 2007
Subject: RE: logger w/o any appender

I would say that if the situation that a warning is pointing out is as
expected, you can ignore it (after all, it's a warning, not an error).
However, commonly, you configure loggers to log something, and if there
are no appenders to catch the log messages produced by the logger, 9
times out of 10 that would not be what you want and may indicate a
mistake in your configuration. Hence, a warning is produced.

Apparently, the warning mechanism doesn't check if the logger has been
turned off. (With that said, logger log level configuration tends to be
more dynamic, being changed all the time to change which parts of the
logger tree are examined, while appender configuration is more static;
typically you would not shift around or remove appenders just because
they would not receive any log message for the current logger
configuration. The logger configuration may be different tomorrow, or in
five minutes, at which time a missing appender may well be a problem, so
not checking whether the logger happens to be turned off can actually be
useful, in some situations).

-----Original Message-----
From: Mak, Howard [mailto:hmak@vaultus.com]
Sent: maandag 17 december 2007 20:06
To: 'log4j-user@logging.apache.org'
Subject: logger w/o any appender

If my log4j.properties has
        log4j.logger.MYLOG = OFF
        log4j.additivity.MYLOG = false

Log4j prints
        log4j:WARN No appenders could be found for logger
(MYLOG.SUBLOG).
        log4j:WARN Please initialize the log4j system properly.

Is an appender always required even if log level is OFF?

Thanks for any help.

- Howard

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org




---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org

Mime
View raw message