[logback-user] Tomcat access logs

whatever21 jbakker at veoh.com
Fri Jan 18 04:42:10 CET 2008


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

-- 
View this message in context: http://www.nabble.com/Tomcat-access-logs-tp14946148p14946148.html
Sent from the Logback User mailing list archive at Nabble.com.




More information about the Logback-user mailing list