4 Replies Latest reply on Apr 9, 2015 4:18 PM by muthu8891

    Slf4j + Logback in JBoss-Fuse-6.1.0

    onizuka83

      How can i enable Slf4j and Logback in JBoss-Fuse-6.1.0?

       

      I'm currently working in the beta version (build number 328).

       

      Thanks.

        • 1. Re: Slf4j + Logback in JBoss-Fuse-6.1.0
          davsclaus

          You need to configure pax logging to use logback, there is some pointers form this SO

          http://stackoverflow.com/questions/9794473/how-to-make-logback-a-logging-library-work-with-servicemix-karaf-ops4j-logg

          • 2. Re: Slf4j + Logback in JBoss-Fuse-6.1.0
            onizuka83

            These are the lines i added in the startup.properties:

            org/codehaus/janino/com.springsource.org.codehaus.janino/2.6.1/com.springsource.org.codehaus.janino-2.6.1.jar=7

            org/codehaus/janino/com.springsource.org.codehaus.commons.compiler/2.6.1/com.springsource.org.codehaus.commons.compiler-2.6.1.jar=7

            org/ops4j/pax/logging/pax-logging-api/1.7.1/pax-logging-api-1.7.1.jar=8

            org/ops4j/pax/logging/pax-logging-service/1.7.1/pax-logging-service-1.7.1.jar=8

            org/ops4j/pax/logging/pax-logging-logback/1.7.1/pax-logging-logback-1.7.1.jar=8

             

            I added also the jars needed in the correct path under "system".

             

            And this is my logback.xml:

            <?xml version="1.0" encoding="UTF-8"?>

            <configuration>

              <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">

                <!-- encoders are assigned the type

                     ch.qos.logback.classic.encoder.PatternLayoutEncoder by default -->

                <encoder>

                  <pattern>%d{HH:mm:ss} [%thread] %-5level %logger{36} - %msg%n</pattern>

                </encoder>

              </appender>

              <appender name="FILE" class="ch.qos.logback.core.rolling.RollingFileAppender">

                <file>${karaf.data}/data/log/fuseee.log</file>

                <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">

                  <!-- daily rollover -->

                  <fileNamePattern>${karaf.data}/data/log/fuse.%d{yyyy-MM-dd}.%i.gz</fileNamePattern>

                  <timeBasedFileNamingAndTriggeringPolicy class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">

                    <!-- or whenever the file size reaches 100MB -->

                    <maxFileSize>100MB</maxFileSize>

                  </timeBasedFileNamingAndTriggeringPolicy>

                  <!-- keep 30 days worth of history -->

                  <maxHistory>30</maxHistory>

                </rollingPolicy>

                <append>true</append>

                <encoder>

                  <pattern>%d{HH:mm:ss.SSS} [%thread] %-5level %logger{36} - %msg%n</pattern>

                </encoder>

              </appender>

               <appender name="osgi:VmLogAppender">

               </appender>

              <root level="debug">

                <appender-ref ref="osgi:VmLogAppender"/>

                <appender-ref ref="FILE"/>

                <appender-ref ref="STDOUT"/>

              </root>

            </configuration>

             

            But i can't see any log output from the applications deployed in the container. Can someone help me out?

            Thanks

            • 3. Re: Slf4j + Logback in JBoss-Fuse-6.1.0
              vamshi.chilukamarri

              Hi Mario,

              were you able to resolve this. I am also facing the same issue, where my logs dont write inspite of activity in the runtime.

               

              Thanks

              • 4. Re: Slf4j + Logback in JBoss-Fuse-6.1.0
                muthu8891

                I'm also facing the same issue, Please help me if someone has a solution.