Messages appearing unexpectdely in the console
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Rodrigue_Alcazar
Posted On:   Thursday, August 3, 2006 08:28 AM

I have a problem which origin I cannot find using log4j. I use the current properties file: log4j.logger.comi.runtime=DEBUG, COMI_RUNTIME log4j.appender.COMI_RUNTIME=org.apache.log4j.FileAppender log4j.appender.COMI_RUNTIME.File=logs/comi.log log4j.appender.COMI_RUNTIME.layout=org.apache.log4j.PatternLayout log4j.appender.COMI_RUNTIME.layout.ConversionPattern=%d %4p - %m%n log4j.logger.comi.debug=DEBUG, COMI_DEBUG log4j.appender.COMI_DEBUG=org.apache.log4j.FileAppender log4j.appender.COMI_DEBUG.File=logs/debug.log log4j.appender.COMI_DEBUG.layout=org.apache.log4j.PatternLayout log4j.appender.COMI_DEBUG.layout.ConversionPattern=%d %4p (%F:%L) - %m    More>>

I have a problem which origin I cannot find using log4j. I use the current properties file:


			
log4j.logger.comi.runtime=DEBUG, COMI_RUNTIME
log4j.appender.COMI_RUNTIME=org.apache.log4j.FileAppender
log4j.appender.COMI_RUNTIME.File=logs/comi.log
log4j.appender.COMI_RUNTIME.layout=org.apache.log4j.PatternLayout
log4j.appender.COMI_RUNTIME.layout.ConversionPattern=%d %4p - %m%n

log4j.logger.comi.debug=DEBUG, COMI_DEBUG
log4j.appender.COMI_DEBUG=org.apache.log4j.FileAppender
log4j.appender.COMI_DEBUG.File=logs/debug.log
log4j.appender.COMI_DEBUG.layout=org.apache.log4j.PatternLayout
log4j.appender.COMI_DEBUG.layout.ConversionPattern=%d %4p (%F:%L) - %m


Then, in the class

(severalPackageNames...).comi.InitMiddleware

I call:


			
//The properties file is located at config/middleware.properties
PropertyConfigurator.configure("config" + File.separator
+ "middleware.properties");
Logger.getLogger("comi.runtime").info("Setting a global peer name");



My problem is that although the message appears correctly in the file, I can see on the console


			
INFO [main] (InitMiddleware.java:38) - Setting a global peer name



It is actually the case for all the messages I log from this class, and only from this one. They appear correctly in the log file but appear as well on the console.

If anybody has any idea of what I'm doing wrong...

   <<Less

Re: Messages appearing unexpectdely in the console

Posted By:   Anonymous  
Posted On:   Thursday, August 3, 2006 09:59 AM

Hi I will send u a log4j xml and how to instantiate the log4j.xml in ur java code. I hate writing code in JGuru for its formatting problem. Plz send me ur email and i will send u all the necessary files.

My email: Surjendu.Pooja@gmail.com
About | Sitemap | Contact