dcsimg
Log4j logging data twice
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   S_V
Posted On:   Wednesday, August 29, 2007 03:52 PM

Hi, I am trying to set up a logger for my project as below log4j.logger.projectinfoLogger=DEBUG,projectConsoleAppender # Appender to write to console log4j.appender.projectConsoleAppender=org.apache.log4j.ConsoleAppender log4j.appender.projectConsoleAppender.layout=org.apache.log4j.PatternLayout log4j.appender.projectConsoleAppender.layout.ConversionPattern= [%d{MM/dd/yyyy HH:mm:ss aaa z}] [%3p] (%F:%M:%L)::%m %n Calling of logger private static Logger logger = Logger.getLogger( "warrantyinfoLogger" ); logger.debug("KEY [" + key + "]" + " Value [" + value+ "]"   More>>

Hi,

I am trying to set up a logger for my project as below


log4j.logger.projectinfoLogger=DEBUG,projectConsoleAppender



# Appender to write to console
log4j.appender.projectConsoleAppender=org.apache.log4j.ConsoleAppender


log4j.appender.projectConsoleAppender.layout=org.apache.log4j.PatternLayout


log4j.appender.projectConsoleAppender.layout.ConversionPattern= [%d{MM/dd/yyyy HH:mm:ss aaa z}] [%3p] (%F:%M:%L)::%m %n





Calling of logger

private static Logger logger = Logger.getLogger( "warrantyinfoLogger" );

logger.debug("KEY [" + key + "]" + " Value [" + value+ "]" );


Now log4j logs twice as below


[08/29/2007 15:35:48 PM EDT] [DEBUG] (PropertyLoader.java:loadProperties:71)::KEY [DB2_SERVER_PORT] Value [50008]


DEBUG projectinfoLogger :KEY [DB2_SERVER_PORT] Value [50008]


Please help
Thanks

   <<Less

Re: Log4j logging data twice

Posted By:   S_V  
Posted On:   Wednesday, August 29, 2007 03:55 PM

Please read the following line


private static Logger logger = Logger.getLogger( "warrantyinfoLogger" );


as below

private static Logger logger = Logger.getLogger( "projectinfoLogger" );
About | Sitemap | Contact