[logback-user] logback.xml with Tomcat 5.5

jendicott jendicott at vizible.com
Mon Oct 29 20:27:18 CET 2007



I am having trouble getting slf4j/logback to work in my webapp that is
getting deployed in Tomcat. I have changed all of my application classes to
import and use the slf4j classes, I compile with them and then deploy a war
that Tomcat expands into the webapp dir. My logback.xml file shows up in the
WEB-INF/classes directory of my application but no log file gets
created/written to. I used the log4j Properties translator page to get this
xml:
<?xml version="1.0" encoding="UTF-8"?>

<configuration>
  <appender name="F"
class="ch.qos.logback.core.rolling.RollingFileAppender">
    <File>${catalina.base}/logs/srvc2.log</File>
    <layout class="ch.qos.logback.classic.PatternLayout">
      <pattern>%d{dd MMM yyyy HH:mm:ss} %c{3}:%L - %m%n</pattern>
    </layout>
    <rollingPolicy
class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
      <fileNamePattern>'.'yyyy-MM-dd</fileNamePattern>
    </rollingPolicy>
  </appender>
  <logger name="com.opensymphony.oscache">
    <level value="ERROR"/>
  </logger>
... in here there a bunch more logger elements that set the level for
various things.
  <logger name="com.vizible">
    <level value="DEBUG"/>
  </logger>
  <root>
    <level value="INFO"/>
    <appender-ref ref="F"/>
  </root>
</configuration>

I am expecting to see a file in the Tomcat logs directory called "srvc2.log"
but I don't see anything and none of the regular Tomcat logs show anything.
I am running Tomcat as a service in windows XP.

Am I missing something?? Any suggestions would be appreciated.

--
View this message in context:
http://www.nabble.com/logback.xml-with-Tomcat-5.5-tf4713692.html#a13474065
Sent from the Slf4J - user mailing list archive at Nabble.com.


-- 
View this message in context: http://www.nabble.com/logback.xml-with-Tomcat-5.5-tf4714034.html#a13475065
Sent from the Logback User mailing list archive at Nabble.com.




More information about the Logback-user mailing list