0 Replies Latest reply on Jan 14, 2016 4:25 PM by KRISHNA KANAKALA

    Creating seperate log files for each application/project

    KRISHNA KANAKALA Novice

      Hello,

       

      Followed same instructions in thread, doesn't help me

       

      Re: RED HAT JBOSS FUSE ESB 6.00 Logging sperately for each bundle

       

       

      reproduced from above thread

       

       

      Following the steps as below to generate separate logging for each app

       

      Add the following as spring to camel-context.xml

      <bean class="org.springframework.beans.factory.config.MethodInvokingFactoryBean">

      <property name="targetClass">

      <value>org.apache.log4j.MDC</value>

      </property>

      <property name="targetMethod">

      <value>put</value>

      </property>

      <property name="arguments">

      <list>

      <value>app.name</value>

      <value><<myapp>></value>

      </list>

      </property>

      </bean>

       

      Add the following inside org.ops4j.pax.logging.cfg under etc folder

       

      Before modifying below content take backup copy of org.ops4j.pax.logging.cfg and rename to org.ops4j.pax.logging.cfg.org

       

      # Sift appender

         

      log4j.appender.sift=org.apache.log4j.sift.MDCSiftingAppender

      log4j.appender.sift.key=app.name

      log4j.appender.sift.default=servicemix

      #log4j.appender.sift.appender=org.apache.log4j.FileAppender

      log4j.appender.sift.appender=org.apache.log4j.DailyRollingFileAppender

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

      log4j.appender.sift.appender.layout.ConversionPattern=%d{ABSOLUTE} | %-5.5p | %-16.16t | %-32.32c{1} | %m%n

      log4j.appender.sift.appender.file=${karaf.data}/log/$\\{app.name\\}.log

      log4j.appender.sift.appender.append=true

       

       

      Please let me know if any body able create logs for each and every application.

       

      Thanks,

      Krishna