Breaking News
Home / Java / Java FAQ / How to you specify which logger implementation to be used by Apache Commons Logging?

How to you specify which logger implementation to be used by Apache Commons Logging?

Answer

The Apache Commons Logging provides a high level interface class to allow developers to write to log stream abstracting the logging implementation. The Commons Logging Framework can automatically find & configure it self to an available logging implementation or it can be configure by specifying a logging implementation e.g. Log4j by adding the following properties in commons-logging.properties file.

org.apache.commons.logging.Log=org.apache.commons.logging.impl.Log4JLogger
org.apache.commons.logging.LogFactory=org.apache.commons.logging.impl.LogFactoryImpl

Please make sure this file is in the class path, rest it will configure automatically.

[pb_builder]

Check Also

When is OCAJP Java certification going live?

After completing the BETA phase of testing last year, the Oracle’s new OCAJP Java certification, …

Leave a Reply