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 Adrian Sandor <ad...@yahoo.com> on 2006/11/28 04:56:04 UTC

Logging to multiple appenders with different levels

Hi, I'll try to explain my problem with a simplified example:
Let's say I have two appenders: main and db. In main I want to log everything from the application at debug level, except java.sql stuff which should only log at warn level. In the db appender, I want to log only java.sql messages at debug level (so warn or higher levels will go to both appenders). How can I define that in my log4j.properties?

Thanks
Adrian




 
____________________________________________________________________________________
Want to start your own business?
Learn how on Yahoo! Small Business.
http://smallbusiness.yahoo.com/r-index

Re: Logging to multiple appenders with different levels

Posted by James Stauffer <st...@gmail.com>.
I am not sure that it would work to do that because you have two
levels (debug and warn) that you want to use for java.sql.  You may be
able to do it with customer filters.  Are you using .properties, .xml,
or code for config?  Please provide an attempt to achieve this any
maybe we can tweak it to work.

On 11/27/06, Adrian Sandor <ad...@yahoo.com> wrote:
> Hi, I'll try to explain my problem with a simplified example:
> Let's say I have two appenders: main and db. In main I want to log everything from the application at debug level, except java.sql stuff which should only log at warn level. In the db appender, I want to log only java.sql messages at debug level (so warn or higher levels will go to both appenders). How can I define that in my log4j.properties?
>
> Thanks
> Adrian
>
>
>
>
>
> ____________________________________________________________________________________
> Want to start your own business?
> Learn how on Yahoo! Small Business.
> http://smallbusiness.yahoo.com/r-index
>


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