I am not sure about properties configuration. But with xml configuration I 
would do:

- define one logger (your package name, level debug)
- assign two appenders to this logger:
    - appender1: with level range filter error and higher
    - appender2: without level range filter

Heri

> -----Original Message-----
> From: Nitin Kumar Gupta [mailto:nitinkumargu...@gmail.com] 
> Sent: Tuesday, May 17, 2011 5:33 PM
> To: log4j-user@logging.apache.org
> Subject: is it possible to have different log level for same package
> 
> 
> suppose I have a package com.foo.hello ,
> 
> can I define log level and appender such that error logs goes 
> to one file and all other (even including error, if possible) 
> goes to another file.
> 
> I tried as follows, but last one is always overwriting first one
> 
> log4j.logger.com.foo.hello=ERROR, FOO_1
> log4j.logger.com.foo.hello=DEBUG, FOO_2
> 
> and appender as 
> 
> log4j.appender.FOO_1=org.apache.log4j.RollingFileAppender
> log4j.appender.FOO_1.File=../log/foo_error.log
> &
> log4j.appender.FOO_2=org.apache.log4j.RollingFileAppender
> log4j.appender.FOO_2.File=../log/foo_all.log
> 
> Can someone please help me on that?
> 
> Thanks a ton
> Nitin
> 
> --
> View this message in context: 
> http://old.nabble.com/is-it-possible-to-have-different-log-lev
> el-for-same-package-tp31638492p31638492.html
> Sent from the Log4j - Users mailing list archive at Nabble.com.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org
> For additional commands, e-mail: log4j-user-h...@logging.apache.org
> 
> 
---------------------------------------------------------------------
To unsubscribe, e-mail: log4j-user-unsubscr...@logging.apache.org
For additional commands, e-mail: log4j-user-h...@logging.apache.org

Reply via email to