You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by ying lcs <yi...@gmail.com> on 2006/11/07 06:02:44 UTC

How to configure 2 logger in the same configuration property file

Hi,
I am new to log4j. Can you please tell me how can i configure 2
loggers in the same properties file:

I have code like this, I only have 2 loggers in my whole application:

Logger normalCaseLogger = Logger.getLogger("NORMAL");
normalCaseLogger.info("normal case logging");

Logger debugLogger = Logger.getLogger("DEBUG");
debugLogger.info("debugging logging");

I have try my properties like this, but nothing get print out:

log4j.rootLogger=NORMAL, DEBUG
log4j.appender.NORMAL=org.apache.log4j.FileAppender
log4j.appender.NORMAL.layout=org.apache.log4j.PatternLayout

# Print the date in ISO 8601 format
log4j.appender.NORMAL.layout.ConversionPattern=%d [%t] %-5p %c - %m%n

# Print only messages of level WARN or above in the package com.foo.
log4j.logger.NORMAL=INFO

log4j.appender.DEBUG =org.apache.log4j.ConsoleAppender
log4j.logger.DEBUG = DEBUG

Thanks for any help.

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