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 Ricardo Lopes <A4...@alunos.ipca.pt> on 2005/07/20 12:28:56 UTC

Appenders with different levels on the same logger, how?

Hi,

Can anybody tell me how can i have on the same logger (ex. 
log4j.rootLogger) two different appenders, one for level ERROR or higher 
that is a ConsoleAppender and the other for level INFO or higher that is 
a FileAppender?

Is it possible?

Thanks,
Ricardo Lopes.

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


Re: Appenders with different levels on the same logger, how?

Posted by Ricardo Lopes <A4...@alunos.ipca.pt>.
Thanks,

I didn't knew that the Appenders had the Threshold property, i thought 
that the logging level was Category dependant.

It rocks !!

Thank you very much,
Ricardo Lopes.

Javier Gonzalez wrote:

>Yes, you just need to set the Threshold on each appender to the
>desired level and assign both of them to the root logger.
>
>On 7/20/05, Ricardo Lopes <A4...@alunos.ipca.pt> wrote:
>  
>
>>Hi,
>>
>>Can anybody tell me how can i have on the same logger (ex.
>>log4j.rootLogger) two different appenders, one for level ERROR or higher
>>that is a ConsoleAppender and the other for level INFO or higher that is
>>a FileAppender?
>>
>>Is it possible?
>>
>>Thanks,
>>Ricardo Lopes.
>>
>>---------------------------------------------------------------------
>>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: Appenders with different levels on the same logger, how?

Posted by Javier Gonzalez <ja...@gmail.com>.
Yes, you just need to set the Threshold on each appender to the
desired level and assign both of them to the root logger.

On 7/20/05, Ricardo Lopes <A4...@alunos.ipca.pt> wrote:
> Hi,
> 
> Can anybody tell me how can i have on the same logger (ex.
> log4j.rootLogger) two different appenders, one for level ERROR or higher
> that is a ConsoleAppender and the other for level INFO or higher that is
> a FileAppender?
> 
> Is it possible?
> 
> Thanks,
> Ricardo Lopes.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscribe@logging.apache.org
> For additional commands, e-mail: log4j-user-help@logging.apache.org
> 
> 


-- 
Javier Gonzalez Nicolini

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