Apache Commons Logging (JCL) provides a logging API which can be used with any logging implementation library like log4j. Developer logs messages with JCL API but during runtime any implementation can be set up to be used.
Log: The main interface for logging messages with desired priority (the logging level).
How it works:
JCL uses a runtime discovery algorithm that looks for a logging implementation in the classpath. Once an implementation found, a corresponding adapter is used to forward logging calls to that specific implementation. These adapters are nothing but the implementations of org.apache.commons.logging.Log (the main logging interface, as mentioned above). In JCL version 1.2 followings adapters are available: Note that SimpleLog is JCL's own implementation.
Bridges:
Other than above ready to use adapters, an external adapter can also be hooked up by providing a bridge dependency. This mechanism allows us to use whatever logging implementation we want to. The bridge should provide both a LogFactory and Log implementation. We just have to make JCL aware of our LogFactory implementation as described in the API docs (Check out "Choosing a LogFactory Implementation" section). Log4j 2 provides the similar bridge via log4j-jcl.jar:
What is the default?
If no implementations of a logging framework is available then Jdk14Logger is used, which forwards logging messages to Java Util logging (JUL).