1 Reply Latest reply on Jun 4, 2012 12:41 PM by Vincent Mahe

    Logging Question

    Eric Bender Newbie

      Greetings, I have edited my /etc/org.ops4j.pax.logging.cfg file to the following, to allow each bundle to create a separate log file.  Unfortunately, the max file size and log indexing seems to not work when using the sift appender.  I will attach the config file, but currently all the logs only write to a single log and it can grow to an unrestricted size.

       

      What am I doing wrong that prevents the log files from being indexed and rolling over?

       

      # Root logger
      log4j.rootLogger = INFO, sift, osgi:VmLogAppender
      log4j.throwableRenderer=org.apache.log4j.OsgiThrowableRenderer
      
      log4j.appender.sift.key=app.name
      log4j.appender.sift.appender.file=${karaf.data}/log/$\\{app.name\\}.log
      
      # CONSOLE appender not used by default
      log4j.appender.stdout=org.apache.log4j.ConsoleAppender
      log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
      log4j.appender.stdout.layout.ConversionPattern=%d [%t] | %-5.5p | %-16.16t | %-32.32c{1} | %X{bundle.id} - %X{bundle.name} - %X{bundle.version} | %m%n
      
      # File appender
      log4j.appender.out=org.apache.log4j.RollingFileAppender
      log4j.appender.out.layout=org.apache.log4j.PatternLayout
      log4j.appender.out.layout.ConversionPattern=%d [%t] | %-5.5p | %-16.16t | %-32.32c{1} | %X{bundle.id} - %X{bundle.name} - %X{bundle.version} | %m%n
      log4j.appender.out.file=${karaf.data}/log/servicemix.log
      log4j.appender.out.append=true
      log4j.appender.out.maxFileSize=10MB
      log4j.appender.out.maxBackupIndex=10
      
      # Sift appender
      log4j.appender.sift=org.apache.log4j.sift.MDCSiftingAppender
      log4j.appender.sift.default=servicemix
      log4j.appender.sift.appender=org.apache.log4j.FileAppender
      log4j.appender.sift.appender.layout=org.apache.log4j.PatternLayout
      log4j.appender.sift.appender.layout.ConversionPattern=%d [%t] | %-5.5p | %-16.16t | %-32.32c{1} | %m%n
      log4j.appender.sift.appender.append=true
      log4j.appender.sift.maxFileSize=10MB
      log4j.appender.sift.maxBackupIndex=10
      log4j.logger.org.apache.camel = INFO