It isn't hard to make one logger have more detail than the other
loggers when using the same appender but filtering out error and fatal
would probably require special filters on the appender (maybe even
custom filters).

On 2/15/07, Drinkwater, GJ (Glen) <[EMAIL PROTECTED]> wrote:
Hi

Thanks for the help.  Also, is it possible to level filter a package
like you can do with a appender.

What I have done is to set the root threshold to FATAL and then for
certain packages lower the level to DEBUG or INFO.  But for this one
package, I want to see the info and traces logged etc, but not to log
the ERROR or FATAL.

Is this possible?

glen

-----Original Message-----
From: Kamal Ahmed [mailto:[EMAIL PROTECTED]
Sent: 15 February 2007 15:40
To: Log4J Users List
Subject: RE: Log4j xml configuration

Glen,

Here is a sample which will help you understand how you can use xml
config file, basically you use the format:
        <level value="info" />

In the logger section:

Here are the file contents:

<?xml version="1.0" encoding="UTF-8" ?>
<webm_journal_logging>
    <appender name="StdErr" class="org.apache.log4j.ConsoleAppender">
        <param name="target" value="System.Err" />
        <layout
class="com.webmethods.sc.logging.log4j.DefaultG8dEventLayout" />
    </appender>
<!--  This appender will send log messages with a level of 'warn'
          and above to './log/server.log'; with daily rollover to,
          e.g. './log/server.log.2006-07-17'.
    -->
    <appender name="DailyFile"
class="com.webmethods.sc.logging.log4j.WmDailyFileAppender">
        <param name="file" value="log/server.log" />
        <param name="datePattern" value=".yyyy-MM-dd" />
        <param name="threshold" value="debug" />
        <layout
class="com.webmethods.sc.logging.log4j.DefaultG8dEventLayout" />
    </appender>
    <logger name="webm.sc.sample.sub1" additivity="true">
        <level value="info" />
        <appender-ref ref="StdErr" />
        <appender-ref ref="DailyFile" />
    </logger>
    <root>
        <level value="debug" />
        <appender-ref ref="DailyFile" />
        <appender-ref ref="StdErr" />
    </root>
    <threshold>
        <level value="debug" />
    </threshold>
</webm_journal_logging>


-Kamal.


-----Original Message-----
From: Drinkwater, GJ (Glen) [mailto:[EMAIL PROTECTED]
Sent: Wednesday, February 14, 2007 8:20 AM
To: log4j-user@logging.apache.org
Subject: Log4j xml configuration

Hi

I am currently moving all our log4j.properties files to XML files and
was wondering how I replicate this with the xml configuration.

In the properties file, I can put in

log4j.logger.my.package=DEBUG

Which means only logs from 'my.package' with level DEBUG or above gets
logged and anything outside these package does not.

How do I do this with an XML configuration.

Thanks Glen

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




--
James Stauffer        http://www.geocities.com/stauffer_james/
Are you good? Take the test at http://www.livingwaters.com/good/

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to