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

    Slf4j + Logback in JBoss-Fuse-6.1.0

    Mario Gallo Newbie

      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.

        • 2. Re: Slf4j + Logback in JBoss-Fuse-6.1.0
          Mario Gallo Newbie

          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 Newbie

            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
              Muthu Veerappan Newbie

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