logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kannan Ekanath <kannan.ekan...@gmail.com>
Subject Re: How to filter the unnecessary log messages
Date Mon, 09 Mar 2009 12:58:32 GMT
[Not pasting the big log file]
You need to use a log4j.xml in the classpath. The format/how to of the
log4j.xml is explained in this link
http://logging.apache.org/log4j/1.2/manual.html

Many examples are provided here
http://wiki.apache.org/logging-log4j/Log4jXmlFormat.

To cut the short story even shorter, the below xml directs all output from
any class under "my.package.*" to the SERVER-FILE.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">

<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/"
debug="false">

    <!-- server log file, for server use -->
    <appender name="SERVER-FILE"
class="org.jboss.logging.appender.DailyRollingFileAppender">
        <param name="File" value="app-server.log"/>
        <param name="Append" value="true"/>
    </appender>
    <!--INFO and above goes to the file -->
<category name="my.package">
        <priority value="INFO"/>
        <appender-ref ref="SERVER-FILE"/>
    </category>

    <root>
        <appender-ref ref="SERVER-FILE"/>
    </root>
</log4j:configuration>

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