You are viewing a plain text version of this content. The canonical link for it is here.
Posted to log4j-user@logging.apache.org by Daniel Henninger <ja...@nc.rr.com> on 2007/08/03 20:37:33 UTC

How to stop further processing?

Hi folk!

I'm trying to switch my project to log4j and am running into an issue  
where... ok here's what I've done (conceptually)

log4j.appender.myappender is set to ....MyAppender
log4j.appender.myappender2 is set to ....MyAppender2
log4j.rootLogger is set to myappender
log4j.logger.some.class.tree is set to myappender2

When something in some.class.tree logs, the log entry goes to both  
MyAppender2 and MyAppender.  What I'm really after is for MyAppender2  
to 'override' the root logger for that particular tree.  Is there  
something obvious I'm missing?  Is this not possible?  Any  
suggestions?  Thanks!!

Daniel



---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


Re: How to stop further processing?

Posted by Matthew Kemp <ma...@gmail.com>.
Setting additivity to false should fix your problem. I'm not sure about the
properties log4j config, but in log4j.xml it's just an attribute on the
logger.

On 8/3/07, Daniel Henninger <ja...@nc.rr.com> wrote:
>
> Hi folk!
>
> I'm trying to switch my project to log4j and am running into an issue
> where... ok here's what I've done (conceptually)
>
> log4j.appender.myappender is set to ....MyAppender
> log4j.appender.myappender2 is set to ....MyAppender2
> log4j.rootLogger is set to myappender
> log4j.logger.some.class.tree is set to myappender2
>
> When something in some.class.tree logs, the log entry goes to both
> MyAppender2 and MyAppender.  What I'm really after is for MyAppender2
> to 'override' the root logger for that particular tree.  Is there
> something obvious I'm missing?  Is this not possible?  Any
> suggestions?  Thanks!!
>
> Daniel
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-user-help@logging.apache.org
>
>

Re: How to stop further processing?

Posted by Daniel Henninger <ja...@nc.rr.com>.
Awesome, thank you!  That is exactly what I was after!  I found the  
full string in another list post so I thought I'd go ahead and post  
it here in case anyone else runs into this thread:
log4j.additivity.<enter fully qualified class name here>=false

Daniel

On Aug 3, 2007, at 2:42 PM, James Stauffer wrote:

> Yes.  You need to set "additivity" to false for some.class.tree.  I am
> not sure how to do that in a properties file.
>
> On 8/3/07, Daniel Henninger <ja...@nc.rr.com> wrote:
>> Hi folk!
>>
>> I'm trying to switch my project to log4j and am running into an issue
>> where... ok here's what I've done (conceptually)
>>
>> log4j.appender.myappender is set to ....MyAppender
>> log4j.appender.myappender2 is set to ....MyAppender2
>> log4j.rootLogger is set to myappender
>> log4j.logger.some.class.tree is set to myappender2
>>
>> When something in some.class.tree logs, the log entry goes to both
>> MyAppender2 and MyAppender.  What I'm really after is for MyAppender2
>> to 'override' the root logger for that particular tree.  Is there
>> something obvious I'm missing?  Is this not possible?  Any
>> suggestions?  Thanks!!
>>
>> Daniel
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
>> For additional commands, e-mail: log4j-user-help@logging.apache.org
>>
>>
>
>
> -- 
> James Stauffer        http://www.geocities.com/stauffer_james/
> Are you good? Take the test at http://www.livingwaters.com/good/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-user-help@logging.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org


Re: How to stop further processing?

Posted by James Stauffer <st...@gmail.com>.
Yes.  You need to set "additivity" to false for some.class.tree.  I am
not sure how to do that in a properties file.

On 8/3/07, Daniel Henninger <ja...@nc.rr.com> wrote:
> Hi folk!
>
> I'm trying to switch my project to log4j and am running into an issue
> where... ok here's what I've done (conceptually)
>
> log4j.appender.myappender is set to ....MyAppender
> log4j.appender.myappender2 is set to ....MyAppender2
> log4j.rootLogger is set to myappender
> log4j.logger.some.class.tree is set to myappender2
>
> When something in some.class.tree logs, the log entry goes to both
> MyAppender2 and MyAppender.  What I'm really after is for MyAppender2
> to 'override' the root logger for that particular tree.  Is there
> something obvious I'm missing?  Is this not possible?  Any
> suggestions?  Thanks!!
>
> Daniel
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-user-help@logging.apache.org
>
>


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

---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
For additional commands, e-mail: log4j-user-help@logging.apache.org