Discussions

EJB design: Log4J property file help

  1. Log4J property file help (1 messages)

    Hi,

       I am using log4j as a logging tool. Can any one help me hoe to use categories configured via log4j.properties. Using catageroies is quite understandable from xml file but not sure how to do that from log4j.properties.

      I want to log specific logging to a file(appender). I am refering to this appender from category. Please see below


    log4j.rootCategory=DEBUG,A2,A3,A1,A4,A5

    log4j.appender.A5=org.apache.log4j.RollingFileAppender
    log4j.appender.A5.File=/usr/jakarta/tomcat-5.5.9/jakarta-tomcat-5.5.9/logs/Performance.log
    log4j.appender.A5.MaxFileSize=500KB
    log4j.appender.A5.FilteredLevel=INFO,WARN,ERROR,FATAL
    log4j.appender.A5.MaxBackupIndex=5
    log4j.appender.A5.layout=org.apache.log4j.PatternLayout
    log4j.appender.A5.layout.ConversionPattern=%d{ISO8601} %-5p %x%n LoggingClass[%c]%n LogMessage[%m]%n

    og4j.category.cat2=au.com.medibank.util.logging.LogScopeManager
    log4j.category.cat2.appender-ref.ref=A5


      The problem I am having is still the appender log file is taking all the logs irrespective of the class mentioned in category.

       Ypur help will be greatly appreciated.
  2. Log4J property file help[ Go to top ]

    Try to remove A5 from the log4j.rootCategory entry.