logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jacob Kjome <h...@visi.com>
Subject Re: File is not getting created in log4j v1.3
Date Thu, 06 Oct 2005 18:49:08 GMT
Quoting "Boddapati, Vijaya" <Vijaya.Boddapati@ibx.com>:

> Hi
>  I could successfully write the logging messages to a file when I used
> log4j v.1.2.12. But when I'm trying to use v1.3 and the appender as
> RollingFileAppender, log file is not getting created. Am I missing
> anything regarding the configuration?
>

Here's an example of RollingFileAppender configuration for Log4j-1.3 (examples
below far for configuring Tomcat logging for "localhost" host and "mywebapp"
servlet context logging)...

<appender name="LOCALHOST" class="org.apache.log4j.rolling.RollingFileAppender">
        <rollingPolicy
class="org.apache.log4j.rolling.FixedWindowRollingPolicy">
            <param name="activeFileName"
value="${catalina.base}/logs/localhost.log"/>
            <param name="fileNamePattern"
value="${catalina.base}/logs/localhost.log.%i"/>
        </rollingPolicy>
        <triggeringPolicy
class="org.apache.log4j.rolling.SizeBasedTriggeringPolicy">
            <param name="maxFileSize" value="30000"/>
        </triggeringPolicy>
        <layout class="org.apache.log4j.PatternLayout">
            <param name="ConversionPattern" value="%-5p[%-8.8t]: %39.39c %-6r -
%m%n"/>
        </layout>
    </appender>

OR

<appender name="MYWEBAPP" class="org.apache.log4j.rolling.RollingFileAppender">
        <param name="Append" value="true"/>
        <rollingPolicy class="org.apache.log4j.rolling.TimeBasedRollingPolicy">
            <param name="activeFileName"
value="${catalina.base}/logs/localhost_mywebapp.log"/>
            <param name="fileNamePattern"
value="${catalina.base}/logs/localhost_mywebapp.log.%d"/>
        </rollingPolicy>
        <layout class="org.apache.log4j.PatternLayout">
            <param name="ConversionPattern" value="%c{1} %-6r - %m%n"/>
        </layout>
    </appender>


Jake

> Thanks
> Vijaya
>

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


Mime
View raw message