logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ionel GARDAIS <igard...@yahoo.fr>
Subject switching between two appenders
Date Wed, 29 Sep 2004 12:48:34 GMT

I have two appenders : ConsoleAppender and
These two appenders are attached to a unique logger.

Is there a way to "mute" a logger or the other "on the
fly" so I can log on Console only, FileAppender only
or both ?

BTW, my logging initialization is like this :

Logger log4jLogger = null;
static {
  Layout patternLayout = new PatternLayout("%d [%t]
%-5p - %m%n");
  Appender consoleAppender = new
  log4jLogger = Logger.getLogger("myClass");

As i am adapting a proprietary logging API to Log4j,
this is the only initialization part I am going thru.
Classes never reference the log4jLogger logger.

According to this, what about the rootLogger ?
What are its configuration values (appenders, level) ?
Should I better use
  log4jLogger = Logger.getRootLogger();
instead of
  log4jLogger = Logger.getLogger("myClass");

in order to init only the root logger ?

Thanks for your answers,


Vous manquez d’espace pour stocker vos mails ? 
Yahoo! Mail vous offre GRATUITEMENT 100 Mo !
Créez votre Yahoo! Mail sur http://fr.benefits.yahoo.com/

Le nouveau Yahoo! Messenger est arrivé ! Découvrez toutes les nouveautés pour dialoguer
instantanément avec vos amis. A télécharger gratuitement sur http://fr.messenger.yahoo.com

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

View raw message