logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ying lcs" <ying...@gmail.com>
Subject How to configure 2 logger in the same configuration property file
Date Tue, 07 Nov 2006 05:02:44 GMT
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


Mime
View raw message