How to disable Apache Commons / Log4J logging in third-party libraries?

Is there an Apache Commons / Log4J logging API that can be used to completely disable all protocols, even for logs that are in third-party libraries?

Reference Information. I would like to use java.util.logging in a GlassFish v3 web application. However, the third-party library in this web application uses Log4J logging and Apache Commons Logging. To conserve resources, this log must be minimized or disabled.

+5
source share
3 answers

Change log4j configuration and set logging level to ERROR or FATAL

:

log4j.logger.org.hibernate=ERROR

, , .

+9

. , .

+1

Take a look at http://www.slf4j.org/

It provides versions of the log4j and commons logs that route all messages to the logging implementation of your choice.

0
source

All Articles