UML Overview of x4juli

Classes affecting user code

Using java.util.logging

There is just one class needed: java.util.logging.Logger.
private static final Logger LOG = Logger.getLogger("org.foo.Sample");
Optionally a user might aquire a Logger using the java.util.logging.LogManager, which has the same behaviour as Logger.getLogger(String name):
private static final Logger LOG = LogManager.getLogManager().getLogger("org.foo.Sample");

Using Jakarta Commons Logging

There are two classes needed: org.apache.commons.logging.Log and org.apache.commons.logging.LogFactory.
private static final Log LOG = LogFactory.getLog("org.foo.Sample");

Using Simple Logging Facade for Java

There are two classes needed: org.slf4j.Logger and org.slf4j.LoggerFactory.
private static final Logger LOG = LoggerFactory.getLogger("org.foo.Sample");

Classes NOT affecting user code

The two classes org.x4juli.X4JuliLogger and org.x4juli.X4JuliLogManager do not bother user code. If x4juli is configured properly, and also the correct properties for JCL are set, this classes are behind the interfaces and actually do the logging.
Usually there is no need for any org.x4juli.* import in your code.

org.x4juli.X4JuliLogger

This class extends java.util.logging.Logger and implements org.apache.commons.logging.Log, and org.slf4j.Logger. It overrides all log methods from java.util.logging.Logger to have correct location information, without performance lost. (Obtaining location information is still a costly operation, look at the org.x4juli.formatter.PatternFormatter API Docs for details.)

org.x4juli.X4JuliLogManager

This class extends java.util.logging.LogManager. It is initialized through a static constructor in java.util.logging.LogManager when the property -Djava.util.logging.manager=org.x4juli.X4JuliLogManager is present.