0 Replies Latest reply on Dec 9, 2005 4:40 AM by chaitanya

    if i use log4j.xml file how to write for rootCategory??

    chaitanya Novice


      what is the difference between rootCategory and other categories in log4j.properties;


      To get logged in prod1.log we access in java files like this;

      private Log loggeMemory = LogFactory.getLog("com.common.java");


      i want to know how to write in java file to get logged in prod.log file?

      if i use log4j.xml file how to write for rootCategory??

      log4j.properties


      # Root category
      log4j.rootCategory=debug, R
      log4j.appender.R=org.apache.log4j.RollingFileAppender
      log4j.appender.R.File=log/prod.log
      log4j.appender.R.MaxFileSize=1024KB
      # Keep forty backup files
      log4j.appender.R.MaxBackupIndex=4
      log4j.appender.R.layout=org.apache.log4j.PatternLayout
      log4j.appender.R.layout.ConversionPattern=%d [%-5p] %c{2} %M.%L - %m%n

      # Events category
      log4j.category.com.common.java=debug, E
      log4j.appender.E=org.apache.log4j.RollingFileAppender
      log4j.appender.E.File=log/prod1.log
      log4j.appender.E.MaxFileSize=512KB

      log4j.appender.E.MaxBackupIndex=1
      log4j.appender.E.layout=org.apache.log4j.PatternLayout
      log4j.appender.E.layout.ConversionPattern=%d [%-5p] %c{2} %M.%L - %m%n