1 Reply Latest reply on May 8, 2017 4:20 AM by Viral Gohel

    Logging per bundle and selecting specific bundles in JBOSS FUSE

    Alok Jadhav Newbie

      I am aware about logging per bundle in FUSE. That is achieved as mentioned in this link and this. However I want to select specific bundles for logging (Not all). Do you know how to configure this.

        • 1. Re: Logging per bundle and selecting specific bundles in JBOSS FUSE
          Viral Gohel Newbie

          The links that you referred allow you to configure separate log file per route in Fuse using PAX Logging. If that is what you need, than you need to use the useMDCLogging="true" attribute in your camel-context and add below sample configuration in your logging configuration file (<Fuse_HOME>/etc/org.ops4j.pax.logging.cfg):

           

          ...
          log4j.rootLogger=INFO, async, camel-mdc, osgi:*
          ...

          # Camel MDC appender
          log4j.appender.camel-mdc=org.apache.log4j.sift.MDCSiftingAppender
          log4j.appender.camel-mdc.key=camel.routeId
          log4j.appender.camel-mdc.default=servicemix
          log4j.appender.camel-mdc.appender=org.apache.log4j.FileAppender
          log4j.appender.camel-mdc.appender.layout=org.apache.log4j.PatternLayout
          log4j.appender.camel-mdc.appender.layout.ConversionPattern=%d{ISO8601} | %-5.5p | %-16.16t | %-32.32c{1} | %X{camel.exchangeId} | %m%n
          log4j.appender.camel-mdc.appender.file=${karaf.data}/log/camel-$\\{camel.routeId\\}.log
          log4j.appender.camel-mdc.appender.append=true