The first thing I would encourage you to do is to switch to Log4j 2.
Version 1 will be EOL'd soon.

Gary

On Wed, Jul 29, 2015 at 5:45 PM, Liang, Hsuan Tzu <liahs...@a9.com> wrote:

> Hello everyone,
>
> I am currently encountering a problem that I need to set the log level of
> a certain class while running performance test to prevent too many outputs.
> But while running unit tests, the logs need to be printed out.
>
> This can easily be achieved by setting the log level in the performance
> test code dynamically, but I am wondering if there is any way to configure
> it using the "log4j.properties" file. Is it possible to specify the level
> of a certain logger for different class that are using it?
> Eg:
> log4j.logger.a=debug, while running performance test
> log4j.logger.a=info, while running unit test
>
>
> Thanks,
> Zack
>



-- 
E-Mail: garydgreg...@gmail.com | ggreg...@apache.org
Java Persistence with Hibernate, Second Edition
<http://www.manning.com/bauer3/>
JUnit in Action, Second Edition <http://www.manning.com/tahchiev/>
Spring Batch in Action <http://www.manning.com/templier/>
Blog: http://garygregory.wordpress.com
Home: http://garygregory.com/
Tweet! http://twitter.com/GaryGregory

Reply via email to