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

Many examples are provided here

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/"

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

        <appender-ref ref="SERVER-FILE"/>

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