Class LogbackLogger
Level.ALL
:org.slf4j.Level#ALL
Level.SEVERE
:org.slf4j.Level#ERROR
Level.WARNING
:org.slf4j.Level#WARN
Level.INFO
:org.slf4j.Level#INFO
}Level.CONFIG
:org.slf4j.Level#INFO
withCONFIG
marker.Level.FINE
:org.slf4j.Level#DEBUG
Level.FINER
:org.slf4j.Level#TRACE
Level.FINEST
:org.slf4j.Level#TRACE
withFINEST
marker.Level.OFF
:org.slf4j.Level#OFF
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Marker
Marker used to tag configurationLevel.CONFIG
messages, as checked with sl4jlogger.isInfoEnabled(CONFIG)
.static final Marker
Marker used to tag configurationLogging.FATAL
messages, as checked with sl4jlogger.isErrorEnabled(FATAL)
.static final Marker
Marker used to tag configurationLevel.FINEST
messages, as checked with sl4jlogger.isInfoEnabled(FINEST)
.Logger
Fields inherited from class Logger
global, GLOBAL_LOGGER_NAME
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Logs anCONFIG
message.void
Logs aFINE
message.void
Logs aFINER
message.void
Logs aFINEST
message.getLevel()
Returns the level for this logger.void
Logs anINFO
message.boolean
isLoggable
(Level level) Returnstrue
if the specified level is loggable.void
Logs a record at the specified level.void
Logs a record at the specified level, passing the provided throwable to slf4j api..void
Sets the level for this logger.void
Logs aSEVERE
message.void
Logs aWARNING
message.Methods inherited from class LoggerAdapter
addHandler, entering, entering, entering, exiting, exiting, getDebugLevel, log, log, log, logp, logp, logp, logp, logrb, logrb, logrb, logrb, removeHandler, setFilter, setParent, setUseParentHandlers, throwing, toString
Methods inherited from class Logger
config, fine, finer, finest, getAnonymousLogger, getAnonymousLogger, getFilter, getGlobal, getHandlers, getLogger, getLogger, getName, getParent, getResourceBundle, getResourceBundleName, getUseParentHandlers, info, log, log, logp, logp, logrb, logrb, logrb, logrb, setResourceBundle, severe, warning
-
Field Details
-
FATAL
public static final Marker FATALMarker used to tag configurationLogging.FATAL
messages, as checked with sl4jlogger.isErrorEnabled(FATAL)
. -
CONFIG
public static final Marker CONFIGMarker used to tag configurationLevel.CONFIG
messages, as checked with sl4jlogger.isInfoEnabled(CONFIG)
. -
FINEST
public static final Marker FINESTMarker used to tag configurationLevel.FINEST
messages, as checked with sl4jlogger.isInfoEnabled(FINEST)
. -
logger
public Logger logger
-
-
Constructor Details
-
LogbackLogger
-
-
Method Details
-
setLevel
Sets the level for this logger.Care is taken to use reflection to access logback-classic Level and Logger classes (to avoid hard runtime dependency when only the sl4j api is provided at runtime).
Of logback-classic is unavailable level cannot be changed programmatically.
- Specified by:
setLevel
in classLoggerAdapter
- Parameters:
level
- Standard logging level used to configure logger
-
getLevel
Description copied from class:LoggerAdapter
Returns the level for this logger. Subclasses shall get this level from the external logging framework.- Specified by:
getLevel
in classLoggerAdapter
-
isLoggable
Description copied from class:LoggerAdapter
Returnstrue
if the specified level is loggable.Implementation tip
Given thatLevel.intValue()
for all predefined levels are documented in theLevel
specification and are multiple of 100, given that integer divisions are rounded toward zero and given rule documented in this class javadoc, then logging levels can be efficiently mapped to predefined levels usingswitch
statements as below. This statement has good chances to be compiled to thetableswitch
bytecode rather thanlookupswitch
(see Compiling Switches in The Java Virtual Machine Specification).- Specified by:
isLoggable
in classLoggerAdapter
-
log
Description copied from class:LoggerAdapter
Logs a record at the specified level. The default implementation delegates to one of thesevere
,warning
,info
,config
,fine
,finer
orfinest
methods according the supplied level.- Overrides:
log
in classLoggerAdapter
-
severe
Description copied from class:LoggerAdapter
Logs aSEVERE
message.- Specified by:
severe
in classLoggerAdapter
-
warning
Description copied from class:LoggerAdapter
Logs aWARNING
message.- Specified by:
warning
in classLoggerAdapter
-
info
Description copied from class:LoggerAdapter
Logs anINFO
message.- Specified by:
info
in classLoggerAdapter
-
config
Description copied from class:LoggerAdapter
Logs anCONFIG
message.- Specified by:
config
in classLoggerAdapter
-
fine
Description copied from class:LoggerAdapter
Logs aFINE
message.- Specified by:
fine
in classLoggerAdapter
-
finer
Description copied from class:LoggerAdapter
Logs aFINER
message.- Specified by:
finer
in classLoggerAdapter
-
finest
Description copied from class:LoggerAdapter
Logs aFINEST
message.- Specified by:
finest
in classLoggerAdapter
-
log
Logs a record at the specified level, passing the provided throwable to slf4j api..- Overrides:
log
in classLoggerAdapter
-