Uploaded image for project: 'logback'
  1. logback
  2. LOGBACK-324

Logback classic doesn't work with Tomcat when running under Netbeans



    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Critical Critical
    • None
    • 0.9.21
    • None
    • None


      We have a web application running on Tomcat 6.0.26, which uses SLF4J for logging. Until now, we used SLF4J-Simple, and it worked very well. Now we try to switch to Logback, but we are not able to make it work. It works for logging one-line messages. But whenever any exception is thrown on server, which should print a stack trace, server hangs (It doesn't matter whether we actually print the stack trace in log or not). From what I was able to observe, it looks like it falls into endless loop, throwing "ClassNotFoundException: ch.qos.logback.classic.spi.ThrowableProxyUtil", which is caught and tried to be logged, which throws this exception again, and so on. I don't know why it throws this ClassNotFoundException - perhaps classloader issue? But even copying the logback jars to Tomcat's lib directory, I'm not able to run the application: than it has problems with starting up. Sometimes it freezes during loading web app, and often it helps to attach and detach debugger to Tomcat - it's a kind of magic... Anyway, it's horrendously painful, and I'm not able to make it work. Why such common setup (webapp on Tomcat) is not described in Logback documentation???

      This is our configuration file :
      <configuration scan="true">

      <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
      <!-- encoders are assigned the type
      ch.qos.logback.classic.encoder.PatternLayoutEncoder by default -->


      [%thread] %-5level %logger


      - %msg%n%ex</pattern>

      <root level="info">
      <appender-ref ref="STDOUT" />

      (changing scan to "false" doesn't help. Also changing pattern to the one not containing "%ex" doesn't help)

      This is part of pom file related to logging:
      <!-- prevent JCL bundling into final WAR by using scope="provided" -->
      <!-- use this as adpater to satisfy dependencies on JCL -->

      If we change dependency from logback to SLF4J simple (1.6.0) than everything works smoothly, stacktraces are printed to console, no freezing, everything is perfect.




            logback-dev Logback dev list
            grzegorz.borkowski Grzegorz Borkowski
            3 Vote for this issue
            6 Start watching this issue