[logback-user] Tomcat access logs

Jason L. Buberel jason at buberel.org
Mon Jan 21 22:48:39 CET 2008


In our production environment, where we have replaced log4j with logback 
under tomcat, I have the following:

/opt/jakarta-tomcat-5.5.9/server/lib (everything)
-rw-rw-r--    1 jason    altos       24746 Mar 26  2005 catalina-ant.jar
-rw-rw-r--    1 jason    altos      166594 Mar 26  2005 catalina-cluster.jar
-rw-rw-r--    1 jason    altos      636165 Mar 26  2005 catalina.jar
-rw-rw-r--    1 jason    altos      115234 Mar 26  2005 
catalina-optional.jar
-rw-rw-r--    1 jason    altos       63330 Mar 26  2005 
catalina-storeconfig.jar
-rw-rw-r--    1 jason    altos      109670 Mar 26  2005 commons-modeler.jar
-rw-rw-r--    1 jason    altos       21642 Mar 26  2005 
servlets-cgi.renametojar
-rw-rw-r--    1 jason    altos       18062 Mar 26  2005 servlets-default.jar
-rw-rw-r--    1 jason    altos        6008 Mar 26  2005 servlets-invoker.jar
-rw-rw-r--    1 jason    altos       45677 Mar 26  2005 
servlets-ssi.renametojar
-rw-rw-r--    1 jason    altos       22060 Mar 26  2005 servlets-webdav.jar
-rw-rw-r--    1 jason    altos      123399 Mar 26  2005 tomcat-ajp.jar
-rw-rw-r--    1 jason    altos       19247 Mar 26  2005 tomcat-coyote.jar
-rw-rw-r--    1 jason    altos       51679 Mar 26  2005 tomcat-http.jar
-rw-rw-r--    1 jason    altos      245885 Mar 26  2005 tomcat-util.jar

/opt/jakarta-tomcat-5.5.9/webapps/altos/WEB-INF/lib (logging-related only)
-rw-r--r--    1 jason    altos       15435 Aug 26 08:36 
jcl104-over-slf4j.jar
-rw-r--r--    1 jason    altos        9592 Aug 26 08:36 log4j-over-slf4j.jar
-rw-r--r--    1 jason    altos       70919 Aug 26 08:36 logback-access.jar
-rw-r--r--    1 jason    altos      120215 Aug 26 08:36 logback-classic.jar
-rw-r--r--    1 jason    altos      186680 Aug 26 08:36 logback-core.jar
-rw-r--r--    1 jason    altos       15345 Aug 26 08:36 slf4j-api.jar
-rw-r--r--    1 jason    altos        7011 Aug 26 08:36 slf4j-jcl.jar

Does that help?

-jason



whatever21 wrote:
> I forgot to add that I also have logback-classic-0.9.8.jar in my
> .../WEB-INF/lib and TOMCAT_HOME/lib directories.
>
>
>
> whatever21 wrote:
>   
>> Hi, I'm having some problems getting Tomcat (version 6.0.14) access logs
>> to work in conjunction with Logback and my other loggers.
>>  
>> This is what my logback.xml looks like (its exploded into
>> ../WEB-INF/classes/ when I deploy a new .war):
>>
>> <configuration debug="true">
>>
>>     <!-- specify directories where logs should live -->
>>     <substitutionProperty name="logEng.log.dir"
>> value="${base.log.dir}/loggingEngine"/>
>>     <substitutionProperty name="targeting.log.dir"
>> value="${base.log.dir}/targeting"/>
>>     <substitutionProperty name="normalize.log.dir"
>> value="${base.log.dir}/normalize"/>
>>     <substitutionProperty name="cookie.dir"
>> value="/home/tomcat/globalHistory"/>
>>
>>     <appender name="LOGGINGENGINE"
>>               class="ch.qos.logback.core.rolling.RollingFileAppender">
>>         <file>${logEng.log.dir}/logEng.log</file>
>>
>>         <rollingPolicy
>>                
>> class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
>>             <FileNamePattern>
>>                 logEng-%d{yyyy-MM-dd}.log.gz
>>             </FileNamePattern>
>>         </rollingPolicy>
>>
>>         <layout class="ch.qos.logback.classic.PatternLayout">
>>             <Pattern>
>>                 %d{yyyy/MM/dd HH:mm:ss ZZZ}\t%msg%n
>>             </Pattern>
>>         </layout>
>>     </appender>
>>
>>     <appender name="TARGETING"
>>               class="ch.qos.logback.core.rolling.RollingFileAppender">
>>         <file>${targeting.log.dir}/targeting.log</file>
>>
>>         <rollingPolicy
>>                
>> class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
>>             <FileNamePattern>
>>                 targeting-%d{yyyy-MM-dd}.log.gz
>>             </FileNamePattern>
>>         </rollingPolicy>
>>
>>         <layout class="ch.qos.logback.classic.PatternLayout">
>>             <Pattern>
>>                 %d{yyyy/MM/dd HH:mm:ss ZZZ}\t%msg%n
>>             </Pattern>
>>         </layout>
>>     </appender>
>>
>>     <appender name="NORMALIZE"
>>               class="ch.qos.logback.core.rolling.RollingFileAppender">
>>         <file>${normalize.log.dir}/normalize.log</file>
>>
>>         <rollingPolicy
>>                
>> class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
>>             <FileNamePattern>
>>                 normalize-%d{yyyy-MM-dd}.log.gz
>>             </FileNamePattern>
>>         </rollingPolicy>
>>
>>         <layout class="ch.qos.logback.classic.PatternLayout">
>>             <Pattern>
>>                 %msg%n
>>             </Pattern>
>>         </layout>
>>     </appender>
>>
>>     <appender name="COOKIE"
>>               class="ch.qos.logback.core.rolling.RollingFileAppender">
>>         <file>${cookie.dir}/cookie.log</file>
>>
>>         <rollingPolicy
>>                
>> class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
>>             <FileNamePattern>
>>                 cookie-%d{yyyy-MM-dd}.log.gz
>>             </FileNamePattern>
>>         </rollingPolicy>
>>
>>         <layout class="ch.qos.logback.classic.PatternLayout">
>>             <Pattern>
>>                 %msg%n
>>             </Pattern>
>>         </layout>
>>     </appender>
>>
>>     <logger name="CookieLog" additivity="false">
>>         <level value="INFO"/>
>>         <appender-ref ref="COOKIE"/>
>>     </logger>
>>
>>     <logger name="TargetingLog" additivity="false">
>>         <level value="ALL"/>
>>         <appender-ref ref="TARGETING"/>
>>     </logger>
>>
>>     <logger name="NormalizeLog" additivity="false">
>>         <level value="ALL"/>
>>         <appender-ref ref="NORMALIZE"/>
>>     </logger>
>>
>>     <root>
>>         <level value="ALL"/>
>>         <appender-ref ref="LOGGINGENGINE"/>
>>     </root>
>> </configuration>
>>
>> My logback configuration works like a charm but I get no access logs under
>> TOMCAT_HOME/logs
>>
>> Under TOMCAT_HOME/lib/ I have the usual jars and I've added:
>> logback-access-0.9.8.jar
>> logback-core-0.9.8.jar
>>
>> What should I have under ../WEB-INF/lib/?
>>
>> I don't have much experience with logging in general (which is probably
>> apparent :)
>>
>> Thanks,
>> Jennifer
>>
>>
>>     
>
>   
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://qos.ch/pipermail/logback-user/attachments/20080121/241f366f/attachment.htm 


More information about the Logback-user mailing list