On Fri, 24 Feb 2012, Gangemi, Jae wrote:

>  i figured out that i can do this w/ a custom filter on the root logger
> appender. if the category matches Foo and it's log message level is <
> INFO, it will be blocked, otherwise it would logged by the root logger.

That's perfect!

-- 
-- Mike

Mike Schilli
m...@perlmeister.com

>
>  if you think there are any issues w/ that approach, please let me know.
>
>  thanks!
>
> --
> -jae
>
>
>
>
> On 2/23/12 11:22 PM, "Mike Schilli" <m...@perlmeister.com> wrote:
>
>> On Thu, 23 Feb 2012, Gangemi, Jae wrote:
>>
>>> if i add the following to the config:
>>> log4perl.additivity.Foo = 1
>>> the messages are only output by the A2 appender, but that really isn't
>>> the behavior i want.
>>
>> This happens if you set
>>
>>     log4perl.additivity.Foo = 0
>>
>>
>>>  instead, i would like to see is the A2 appender continue to log all
>>> messages coming out of Foo but still have the A1 appender print out any
>>> messages from Foo that are >= the current level of the root appender. so
>>> in this case, the A1 appender would print INFO, WARN, etc messages that
>>> Foo generates.
>>
>> Sounds like you want to set a threshold, check out this recipe:
>>
>> http://search.cpan.org/dist/Log-Log4perl/lib/Log/Log4perl/FAQ.pm#How_can_I
>> _send_errors_to_the_screen,_and_debug_messages_to_a_file?
>>
>> Let me know if that helps ...
>>
>> --
>> -- Mike
>>
>> Mike Schilli
>> m...@perlmeister.com
>>
>>>  suppose i have the following log configuration (yes, i realize appender
>>> definitions are missing, but i don't think they are needed to ask this)
>>> log4perl.rootLogger = INFO, A1
>>> log4perl.category.Foo = ERROR
>>>
>>> --
>>>
>>>  now i want to enable TRACE logging on category FOO and output on a
>>> separate appender, so i would have this:
>>>
>>> --
>>>
>>> log4perl.rootLogger = INFO, A1
>>> log4perl.category.Foo = TRACE, A2
>>>
>>> --
>>>
>>>
>>>  once i do this, i start seeing TRACE messages for Foo also being output
>>> by appender A1, which is expected behavior b/c the A2 appender sends the
>>> message off unconditionally. if i add the following to the config:
>>>
>>> --
>>>
>>> log4perl.additivity.Foo = 1
>>>
>>> --
>>>
>>>  the messages are only output by the A2 appender, but that really isn't
>>> the behavior i want.
>>>
>>>  instead, i would like to see is the A2 appender continue to log all
>>> messages coming out of Foo but still have the A1 appender print out any
>>> messages from Foo that are >= the current level of the root appender. so
>>> in this case, the A1 appender would print INFO, WARN, etc messages that
>>> Foo generates.
>>>
>>>  is there a way to can tell the A2 appender to only forward the message
>>> to the A1 appender if it's >= a certain level?
>>>
>>>  thanks!
>>>
>>> --
>>> -jae
>>>
>>>
>>>
>>>
>>> -------------------------------------------------------------------------
>>> -----
>>> Virtualization & Cloud Management Using Capacity Planning
>>> Cloud computing makes use of virtualization - but cloud computing
>>> also focuses on allowing computing to be delivered as a service.
>>> http://www.accelacomm.com/jaw/sfnl/114/51521223/
>>> _______________________________________________
>>> log4perl-devel mailing list
>>> log4perl-devel@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/log4perl-devel
>>>
>
>
> ------------------------------------------------------------------------------
> Keep Your Developer Skills Current with LearnDevNow!
> The most comprehensive online learning library for Microsoft developers
> is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
> Metro Style Apps, more. Free future releases when you subscribe now!
> http://p.sf.net/sfu/learndevnow-d2d
> _______________________________________________
> log4perl-devel mailing list
> log4perl-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/log4perl-devel
>

------------------------------------------------------------------------------
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing 
also focuses on allowing computing to be delivered as a service.
http://www.accelacomm.com/jaw/sfnl/114/51521223/
_______________________________________________
log4perl-devel mailing list
log4perl-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/log4perl-devel

Reply via email to