2 Replies Latest reply on Mar 20, 2002 5:55 AM by adrian.brock

    Log4J Configuration / Clueless

    andre.anneck

      Hi everyone,

      I am clueless about why this doesnt work. I am trying to use a different category for performance logs, they should land in a differnt logfile. But for some unknown reason the file does not even get created, nor do log-message appear in it.

      Also the [performance] messages do appear in the default-console message ?!?! I am confused, here is my conf and an example call:

      # A log4j properties file suitable for replacing the
      # default JBoss ConsoleLogging & FileLogging mbeans.

      log4j.rootCategory=INFO, Default, Console

      ### Performance Category
      log4j.category.performance=DEBUG, PerformanceAppender

      ### The performance.log file appender
      log4j.appender.PerformanceAppender=org.apache.log4j.FileAppender
      log4j.appender.PerformanceAppender.File=../log/performance.log
      log4j.appender.PerformanceAppender.layout=org.apache.log4j.PatternLayout
      log4j.appender.PerformanceAppender.layout.ConversionPattern=[%t],[%p],[%.50c],[%x],[%m],%n
      log4j.appender.PerformanceAppender.Append=false

      ### The server.log file appender
      log4j.appender.Default=org.apache.log4j.DailyRollingFileAppender
      log4j.appender.Default.File=../log/server.log
      log4j.appender.Default.DatePattern='.'yyyy-MM-dd
      log4j.appender.Default.layout=org.apache.log4j.PatternLayout
      # Use the default JBoss format
      # log4j.appender.Default.layout.ConversionPattern=[%d{ABSOLUTE},%c{1}] %m%n
      log4j.appender.Default.layout.ConversionPattern=[%d] [%t] [%p] [%.50c] [%x] [%m] %n
      # Truncate if it aleady exists.
      log4j.appender.Default.Append=false
      #Example of turning off logging for a category. Uncomment to turn off.
      #log4j.category.DefaultDS=FATAL

      ### The console appender
      log4j.appender.Console=org.jboss.logging.log4j.ConsoleAppender
      #log4j.appender.Console.Threshold=DEBUG
      log4j.appender.Console.layout=org.apache.log4j.PatternLayout
      # log4j.appender.Console.layout.ConversionPattern=[%p,%c{1}] %m%n
      log4j.appender.Console.layout.ConversionPattern=[%p] [%.50c] [%x] %m%n

      -----
      /** Category for Performance */
      private static final Category PERF = Category.getInstance( "performance" );

      PERF.debug( "test...." );
      -----

      I know this is a bit offtopic, but having used log4j in the past I never expirienced and problems. Therefor I anticipate some configuration issue with jboss/log4j combination. I would appreciate any pointers.

      TIA,

      Andre