I use jcl-over-slf4j-1.7.5.jar when I have code that is being registered using JCL, but I want it to use SLF4J? Or something else?
You must use jcl-over-slf4j.jar if you want to port your application using JCL to SLF4J. Both JCL and SLF4J serve as a simple facade or abstraction for various registration frameworks such as Log4J. SLF4J is considered a better solution than JCL because it solves various classloading problems associated with the JCL discovery mechanism. Please note that the release of JCL version 1.1 contains several changes that are designed to fix problems with loading classes.
There are several options for using JCL with SLF4J:
- Solve Commons Logging Class Loader Issues
- You realized that SLF4J is a better logging facade than JCL
- Would you like to use logback , which initially implements the SLF4J API
While you can completely replace the use of JCL SLF4J by replacing JCL API calls with SLF4J API calls, the JCL implementation of SLF4J will allow you to gradually switch to SLF4J, especially if some of your programs depend on your application to use JCL (for example, Spring Framework ) .
When will I use jul-to-slf4j-1.7.5.jar? How is the word "here" used here differently than "above"?
You should use jul-to-slf4j-1.7.5.jar if your application uses java.util.logging (JUL) as its logging structure, and you would like to replace it with SLF4J as a logging facade and have freedom of choice between others logging implementations. JUL provides JavaTM 2 platform logging classes and interfaces. Unlike jcl-over-slf4j , which overrides the JCL, the jul-to-slf4j does not override java.util.logging because the packages are under the java namespace. * Cannot be replaced. Instead, jul-to-slf4j includes a java.util.logging (jul) handler, namely SLF4JBridgeHandler , which routes all incoming jul to API SLF4j entries. Check out SLF4J's performance note for this solution.
Why is there no JAR for JUL? Why is there no "for" JAR for JCL and log4j?
As described in the previous section, packages under the java namespace. * cannot be replaced, and therefore there is no way to create a module "from" the bridge, but rather use a solution that routes the JUL API to SLF4J. For other bridge modules, this overhead is simply not needed.
source share