logging-log4j-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Lisa <l...@purpleblade.net>
Subject Re: Use category to limit by package name possible?
Date Wed, 17 Jan 2007 02:13:45 GMT

James Stauffer <stauffer.james <at> gmail.com> writes:

> 
> 1. <category> -> <logger>
> 2. Remove class attribute from category/logger.
> 3. Define a <root> node at the bottom.


Thanks!  but I still have a few problems.  #3 <root> node was not required.  The
appender stayed the same.  the category (changed to logger) now looks like this:
(note priority is no longer an acceptable tag - changed to level)

    <!-- myfaces-impl -->
    <logger
            name="org.apache.myfaces"
            additivity="false">
        <level value="debug"/>
        <appender-ref ref="JSF.INFO.LOG"/>
    </logger>

But now I want a debug log file with debug messages and above and an info file
with info and above on the same package.  It appears to me that the
name="<package>" is the limiting param but also functions as an id for the
<logger> tag so log4j is complaining. 

    <!-- presence-tech (debug) -->
    <logger
            name="com.presence"
            additivity="false">
        <level value="debug"/>
        <appender-ref ref="PT.DEBUG.LOG"/>
    </logger>

    <!-- presence-tech (info) -->
    <logger
            name="com.presence"
            additivity="false">
        <level value="info"/>
        <appender-ref ref="PT.INFO.LOG"/>
    </logger>

How do I create two loggers that limit to com.presence (one logger for 
debug and one for info)?

Log4J startup gives the following error message:
  log4j:WARN Attribute value "com.presence" of type ID must be unique within 
the document.

So how do you have two loggers that limit to the same package but different
levels (debug,info)?


Thanks

Lisa






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