The
LoggerFactory is a utility class producing Loggers for
various logging APIs, most notably for log4j, logback and JDK 1.4 logging.
Other implementations such as
NOPLogger and
SimpleLogger are also supported.
LoggerFactory is essentially a wrapper around an
ILoggerFactory instance bound with LoggerFactory at
compile time.
Please note that all methods in LoggerFactory are static.
- Author(s):
- Ceki Gülcü
- Robert Elliot
It is LoggerFactory's responsibility to track version changes and manage
the compatibility list.
It is assumed that qualifiers after the 3rd digit have no impact on
compatibility. Thus, 1.5.7-SNAPSHOT, 1.5.7.RC0 are compatible with 1.5.7.
"1.5.5", "1.5.6", "1.5.7", "1.5.8", "1.5.9", "1.5.10" };
Force LoggerFactory to consider itself uninitialized.
This method is intended to be called by classes (in the same package) for
testing purposes. This method is internal. It can be modified, renamed or
removed at any time without notice.
You are strongly discouraged from calling this method in production code.
private final static void bind() { if (msg != null && msg.indexOf("org/slf4j/impl/StaticLoggerBinder") != -1) { .reportFailure("Failed to load class \"org.slf4j.impl.StaticLoggerBinder\"."); + " for further details.");
if (loggerNameList.size() == 0) { .reportFailure("The following loggers will not work becasue they were created"); .reportFailure("during the default configuration phase of the underlying logging system."); for (int i = 0; i < loggerNameList.size(); i++) { + " by your slf4j binding is not compatible with "
"Unexpected problem occured during version sanity check", e);
if (loggerFactoryClassLoader == null) { implementationList.add(path);
if (implementationList.size() > 1) { Util.reportFailure("Class path contains multiple SLF4J bindings."); for (int i = 0; i < implementationList.size(); i++) { + " for an explanation.");
Return a logger named according to the name parameter using the statically
bound
ILoggerFactory instance.
- Parameters:
name
The name of the logger.- Returns:
- logger
Return a logger named corresponding to the class passed as parameter, using
the statically bound
ILoggerFactory instance.
- Parameters:
clazz
the returned logger will be named after clazz- Returns:
- logger
Return the
ILoggerFactory instance in use.
ILoggerFactory instance is bound with this class at compile time.
- Returns:
- the ILoggerFactory instance in use