Just create 2 log4j.properties files: one for unit tests and one for performance tests.  Place these files in different directories and add the appropriate directory to the classpath for each type of test run, respectively.

Jake

On Thu, 30 Jul 2015 00:45:46 +0000
 "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


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