0

I have a webapp in which I am trying to switch from slf4j + jdk14 to slf4j + logback. I have updated the pom.xml and added logback.xml in src/main/resources. When I start the webapp from Netbeans I see this error in the tomcat 6 log:

    java.lang.ClassNotFoundException: ch.qos.logback.access.servlet.TeeFilter
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1680)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526)
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:269)
at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:422)
at org.apache.catalina.core.ApplicationFilterConfig.<init>(ApplicationFilterConfig.java:115)

This is my logback.xml

<configuration>
    <appender name="DB" class="ch.qos.logback.classic.db.DBAppender">
        <connectionSource     class="ch.qos.logback.core.db.DriverManagerConnectionSource">
            <driverClass>oracle.jdbc.OracleDriver</driverClass>
            <url>jdbc:oracle:thin:@mercurio:1521:ass10</url>
            <user>iltest</user>
            <password>iltest</password>
        </connectionSource>
        <sqlDialect>ch.qos.logback.core.db.dialect.OracleDialect</sqlDialect>
        <encoder class="ch.qos.logback.core.encoder.LayoutWrappingEncoder">
            <layout class="it.infoline.jobtime.LogbackLayout" />
        </encoder>
    </appender>

    <logger name="OuvertureWeb" level="INFO"/>
    <logger name="jdbc" level="OFF" />
    <logger name="jdbc.sqlonly" level="OFF" />

    <root level="INFO">
        <appender-ref ref="DB" />
    </root>
</configuration>

Please note that logs are written in the db, so it seems that the whole solution works. But I have the error above in the tomcat log, and I don't know what it is causing it and, above all, if it could be a clue of something erroneously configured.

Thanks for any help Bye Nicola

Nik
  • 247
  • 1
  • 8

1 Answers1

0

Seems like you have missed adding logback-access dependency into your pom.xml file.

Add following dependency into your pom.xml file:

<dependency>
    <groupId>ch.qos.logback</groupId>
    <artifactId>logback-access</artifactId>
    <version>1.0.13</version>
</dependency>
Waheed
  • 1,835
  • 15
  • 21
  • Thanks for suggestion but I've added this dependency and the error is still there. – Nik Dec 27 '13 at 08:18
  • I am not sure but I guess you can give a shot. Copy logback-access jar under $TOMCAT_HOME/lib/ directory, where $TOMCAT_HOME is the folder where you have installed Tomcat. – Waheed Dec 27 '13 at 08:25
  • Looking (better) at the docs (http://logback.qos.ch/access.html#teeFilter) I see that I have not defined the teefilter in my web.xml. Perhaps this is the cause. I am not interested in this kind of log though and, moreover, the last version could also breaks my tomcat 6 server (it's reported at the beginning of the same doc). Perhaps can I safely ignore this warning ? I hope so ... – Nik Dec 27 '13 at 15:55