logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "chuanjiang lo" <lochuanji...@gmail.com>
Subject Setting up log4j.xml
Date Sat, 02 Dec 2006 06:36:38 GMT
Hi all,

I would like to know how i can set up my log4j.xml, for e.g info level would
be printed onto the console where debug level would be log into a file.

These are the snippets of my log4j.xml

<appender name="info-appender" class="org.apache.log4j.ConsoleAppender">
        <layout class="org.apache.log4j.PatternLayout">
            <param name="ConversionPattern" value="%d{dd MMM yyyy HH:mm:ss}
[%t] %-5p %c - %m%n"/>
    </layout>
    </appender>

    <appender name="debug-appender" class="org.apache.log4j.FileAppender">
        <param name="file" value="debug.log"/>
        <layout class="org.apache.log4j.SimpleLayout"/>
    </appender>

    <root>
        <priority value="debug"/>
        <appender-ref ref="debug-appender"/>
    </root>

I'm not very sure how i can set up the environment, probably need some
advice from experienced users.

Appreciate any help

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message