I use log4j for logging and i want to print all logger.debug statements in a particular class / selected package.
i set the cfg as below>
log4j.category.my.pkg=info log4j.category.my.pkg.ab.class1=debug
but still only info messages are shown..
is this not the right way ?
Note that by default Log4j assigns the root logger to Level. ERROR.
Instead of using 'category' use 'logger'. Hence, these level are configured for entire log4j, and does not depend on appender, etc.
Following change works:
log4j.logger.my.pkg=info log4j.logger.my.pkg.ab.class1=debug
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With