logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dvrmc <dvrm.chowd...@aricent.com>
Subject log4j : How to avoid duplicate logmessages in a multithreaded application?
Date Wed, 30 Jan 2008 09:00:21 GMT

Hi,
I m using log4j for my heavily multithreaded JAVA application. After my
application comes up, a few minutes later , I find many duplicate logger
messages on the console(only logger messages in threads are being displayed
8-9 times each). Is it that my application being multithreaded or is there
something wrong with my configuration file?

My log4j-config.xml is as below:-

<?xml version="1.0" encoding="UTF-8"?> 
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
 
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/"
                     configDebug="true">
 
	<appender name="ASYNC" class="org.apache.log4j.AsyncAppender"
additivity="false">
	        <appender-ref ref="TEMP"/>
		<appender-ref ref="CONSOLE"/>
		<appender-ref ref="TRACE"/>
		<appender-ref ref="DEBUG"/>
		<appender-ref ref="INFO"/>
		<appender-ref ref="WARN"/>
		<appender-ref ref="ERROR"/>
		<appender-ref ref="FATAL"/>
	</appender>
 
	<appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
		<!-- param name="ImmediateFlush" value="true"/-->
		<layout class="org.apache.log4j.PatternLayout">
  		     <!-- param name="ConversionPattern" 
                            value="%d %-5p [%t] %C %A (%F:%L) - %m%n"/-->
		</layout>
	</appender>
 
 
	<appender name="TEMP" class="org.apache.log4j.FileAppender">
		
		<layout class="org.apache.log4j.PatternLayout">
  		     
		</layout>
	</appender>
	
 	<appender name="TRACE" class="org.apache.log4j.FileAppender">
	
	
	<layout class="org.apache.log4j.PatternLayout">
	     
		</layout>
	</appender>
 
 	<appender name="DEBUG" class="org.apache.log4j.FileAppender">
	
	
	<layout class="org.apache.log4j.PatternLayout">
	     
		</layout>
	</appender>
 
	<appender name="INFO" class="org.apache.log4j.FileAppender">
	
	<layout class="org.apache.log4j.PatternLayout">
	     
		</layout>
	
		<filter class="org.apache.log4j.varia.LevelMatchFilter">
            		
 	        </filter>
 
	<filter class="org.apache.log4j.varia.DenyAllFilter"/>	
	</appender>
 
	<appender name="WARN" class="org.apache.log4j.FileAppender">
	
	<layout class="org.apache.log4j.PatternLayout">
	     
		</layout>
	
		<filter class="org.apache.log4j.varia.LevelMatchFilter">
            	
            </filter>
	<filter class="org.apache.log4j.varia.DenyAllFilter"/>	
	</appender>
 
	<appender name="ERROR" class="org.apache.log4j.FileAppender">
	
	<layout class="org.apache.log4j.PatternLayout">
	     
		</layout>
	
		<filter class="org.apache.log4j.varia.LevelMatchFilter">
            	
            </filter>
	<filter class="org.apache.log4j.varia.DenyAllFilter"/>	
	</appender>
 
	<appender name="FATAL" class="org.apache.log4j.FileAppender">
	
	<layout class="org.apache.log4j.PatternLayout">
	     
		</layout>
	
		<filter class="org.apache.log4j.varia.LevelMatchFilter">
            	
            </filter>
	<filter class="org.apache.log4j.varia.DenyAllFilter"/>	
	</appender>
 
	<appender name="SLCS" class="org.apache.log4j.FileAppender">
		
		<layout class="org.apache.log4j.PatternLayout">
  		     
		</layout>
	</appender>
 
	<category name="com.aircell.abs.acpu.softwareloadconfig"
additivity="false">
      <level value="debug"/>
	<appender-ref ref="SLCS"/>
      </category>
	
	<root>
		<priority value="info"/>
		<appender-ref ref="ASYNC"/>
	</root>
</log4j:configuration>



Regards.
-- 
View this message in context: http://www.nabble.com/log4j-%3A-How-to-avoid-duplicate-logmessages-in-a-multithreaded-application--tp15177220p15177220.html
Sent from the Log4j - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
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