0 Replies Latest reply on Oct 23, 2012 8:09 AM by mathieu jambou

    Logging per Application for just one application

    mathieu jambou Newbie

      hi,

       

      I would use the Logging per Application just for one of my applications, for the others i would like they continue to write out in servicemix.log

       

      i would like to conserve my property for the out logger.

       

      When i change something either my log for my application works but also for the others application or it's servicemix.log which doesn't converse it's property

       

      here  it's the file pax.logging.cfg in etc:

       

      1. Root logger

      log4j.rootLogger=INFO, out, sift, osgi:VmLogAppender

      log4j.throwableRenderer=org.apache.log4j.OsgiThrowableRenderer

       

      1. File appender

      log4j.appender.out=org.apache.log4j.RollingFileAppender

      log4j.appender.out.layout=org.apache.log4j.PatternLayout

      log4j.appender.out.layout.ConversionPattern=%d | %-5.5p | %-16.16t | %-32.32c

      1. Sift appender
      | %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 log4j.appender.sift = org.apache.log4j.sift.MDCSiftingAppender  log4j.appender.sift.key = client 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 | %-5.5p | %-16.16t | %-32.32c | %m%n 

      log4j.appender.sift.appender.file=${karaf.data}/log/$
      {client
      }.log

      log4j.appender.sift.appender.append = true 

       

       

      and here my code in the bundle that i would log in another file:

       

           MDC.put("client", "test");

           LOGGER.info("Testing LOG Data");

           LOGGER.info(strLine);

           MDC.remove("client");

       

       

      if you have ever do this

       

      thank you