Interface LoggerProvider
-
public interface LoggerProviderDefines the interface for a factory class to provideLoggerinstances for eachSourceobject.It is not usually necessary for users to create implementations of this interface, as several predefined instances are defined which provide the most commonly required
Loggerimplementations.By default, a
LoggerProvideris chosen automatically according to the algorithm described in the staticConfig.LoggerProviderproperty. This automatic choice can be overridden by setting theConfig.LoggerProviderproperty manually with an instance of this interface, but this is also usually not necessary.
-
-
Field Summary
Fields Modifier and Type Field Description static LoggerProviderDISABLEDALoggerProviderimplementation that disables all log messages.static LoggerProviderJAVAALoggerProviderimplementation that wraps the standardjava.util.loggingsystem included in the Java SDK version 1.4 and above.static LoggerProviderJCLALoggerProviderimplementation that wraps the Jakarta Commons Logging (JCL) framework.static LoggerProviderLOG4JALoggerProviderimplementation that wraps the Apache Log4J framework.static LoggerProviderSLF4JALoggerProviderimplementation that wraps the SLF4J framework.static LoggerProviderSTDERRALoggerProviderimplementation that sends all log messages to the standard error output stream (System.err).
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description LoggergetLogger(java.lang.String name)Creates a newLoggerinstance with the specified name.
-
-
-
Field Detail
-
DISABLED
static final LoggerProvider DISABLED
ALoggerProviderimplementation that disables all log messages.
-
STDERR
static final LoggerProvider STDERR
ALoggerProviderimplementation that sends all log messages to the standard error output stream (System.err).The implementation uses the following code to create each logger:
newWriterLogger(new OutputStreamWriter(System.err),name)
-
JAVA
static final LoggerProvider JAVA
ALoggerProviderimplementation that wraps the standardjava.util.loggingsystem included in the Java SDK version 1.4 and above.This is the default used if no other logging framework is detected. See the description of the static
Config.LoggerProviderproperty for more details.The following mapping of logging levels is used:
Loggerleveljava.util.logging.LevelERRORSEVEREWARNWARNINGINFOINFODEBUGFINE
-
JCL
static final LoggerProvider JCL
ALoggerProviderimplementation that wraps the Jakarta Commons Logging (JCL) framework.See the description of the static
Config.LoggerProviderproperty for details on when this implementation is used as the default.The following mapping of logging levels is used:
Loggerlevelorg.apache.commons.logginglevelERRORerrorWARNwarnINFOinfoDEBUGdebug
-
LOG4J
static final LoggerProvider LOG4J
ALoggerProviderimplementation that wraps the Apache Log4J framework.See the description of the static
Config.LoggerProviderproperty for details on when this implementation is used as the default.The following mapping of logging levels is used:
Loggerlevelorg.apache.log4j.LevelERRORERRORWARNWARNINFOINFODEBUGDEBUG
-
SLF4J
static final LoggerProvider SLF4J
ALoggerProviderimplementation that wraps the SLF4J framework.See the description of the static
Config.LoggerProviderproperty for details on when this implementation is used as the default.The following mapping of logging levels is used:
Loggerlevelorg.slf4j.LoggerlevelERRORerrorWARNwarnINFOinfoDEBUGdebug
-
-
Method Detail
-
getLogger
Logger getLogger(java.lang.String name)
Creates a newLoggerinstance with the specified name.The
nameargument is used by the underlying logging implementation, and is normally a dot-separated name based on the package name or class name of the subsystem.The name used for all automatically created
Loggerinstances is "net.htmlparser.jericho".- Parameters:
name- the name of the logger, the use of which is determined by the underlying logging implementation, may benull.- Returns:
- a new
Loggerinstance with the specified name.
-
-