Hello log4j-user Team,
   
  I would be highly thankful to your guidance in this regard.I am changing 
log4j properties file to remove duplicate loggings for few of the java beans.
   
  This is how my properties files looks like -
   
  log4j.appender.OPC=org.apache.log4j.DailyRollingFileAppender
  log4j.appender.OPC.DatePattern='.'yyyy-MM-dd
  log4j.appender.OPC.File=/log/bea/opc/opc_1.log
  log4j.appender.OPC.layout=org.apache.log4j.PatternLayout
  log4j.appender.OPC.layout.ConversionPattern=%d{EEE MMM dd HH:mm:ss z yyyy} 
%-5p %c - %m%n
  # Set the root category default to DEBUG (default...).
  log4j.rootCategory=DEBUG, OPC
  log4j.additivity.com.onstar.pc.beans=FALSE
  log4j.additivity.com.onstar.pc.admin=FALSE
   
  Here I have set additivity property to false so that classes within beans and 
admin package are not logged twice. But I am still getting duplicate messages 
for classes within these package.
  In my java class, I am importing  org.apache.log4j.Category and getting 
logger by
   org.apache.log4j.Category Logger = getLogger() and using in code as 
  Logger.debug("writing the message");
   
  Please advise how can I remove duplicate logging.
   
  Thanks
  Pavi



                
---------------------------------
Yahoo! Photos
 Ring in the New Year with Photo Calendars. Add photos, events, holidays, 
whatever.

Reply via email to