Class LogbackLogger
Level.ALL:org.slf4j.Level#ALLLevel.SEVERE:org.slf4j.Level#ERRORLevel.WARNING:org.slf4j.Level#WARNLevel.INFO:org.slf4j.Level#INFO}Level.CONFIG:org.slf4j.Level#INFOwithCONFIGmarker.Level.FINE:org.slf4j.Level#DEBUGLevel.FINER:org.slf4j.Level#TRACELevel.FINEST:org.slf4j.Level#TRACEwithFINESTmarker.Level.OFF:org.slf4j.Level#OFF
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final MarkerMarker used to tag configurationLevel.CONFIGmessages, as checked with sl4jlogger.isInfoEnabled(CONFIG).static final MarkerMarker used to tag configurationLogging.FATALmessages, as checked with sl4jlogger.isErrorEnabled(FATAL).static final MarkerMarker used to tag configurationLevel.FINESTmessages, as checked with sl4jlogger.isInfoEnabled(FINEST).LoggerFields inherited from class Logger
global, GLOBAL_LOGGER_NAME -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidLogs anCONFIGmessage.voidLogs aFINEmessage.voidLogs aFINERmessage.voidLogs aFINESTmessage.getLevel()Returns the level for this logger.voidLogs anINFOmessage.booleanisLoggable(Level level) Returnstrueif the specified level is loggable.voidLogs a record at the specified level.voidLogs a record at the specified level, passing the provided throwable to slf4j api..voidSets the level for this logger.voidLogs aSEVEREmessage.voidLogs aWARNINGmessage.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, toStringMethods 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.FATALmessages, as checked with sl4jlogger.isErrorEnabled(FATAL). -
CONFIG
public static final Marker CONFIGMarker used to tag configurationLevel.CONFIGmessages, as checked with sl4jlogger.isInfoEnabled(CONFIG). -
FINEST
public static final Marker FINESTMarker used to tag configurationLevel.FINESTmessages, 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:
setLevelin classLoggerAdapter- Parameters:
level- Standard logging level used to configure logger
-
getLevel
Description copied from class:LoggerAdapterReturns the level for this logger. Subclasses shall get this level from the external logging framework.- Specified by:
getLevelin classLoggerAdapter
-
isLoggable
Description copied from class:LoggerAdapterReturnstrueif the specified level is loggable.Implementation tip
Given thatLevel.intValue()for all predefined levels are documented in theLevelspecification 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 usingswitchstatements as below. This statement has good chances to be compiled to thetableswitchbytecode rather thanlookupswitch(see Compiling Switches in The Java Virtual Machine Specification).- Specified by:
isLoggablein classLoggerAdapter
-
log
Description copied from class:LoggerAdapterLogs a record at the specified level. The default implementation delegates to one of thesevere,warning,info,config,fine,finerorfinestmethods according the supplied level.- Overrides:
login classLoggerAdapter
-
severe
Description copied from class:LoggerAdapterLogs aSEVEREmessage.- Specified by:
severein classLoggerAdapter
-
warning
Description copied from class:LoggerAdapterLogs aWARNINGmessage.- Specified by:
warningin classLoggerAdapter
-
info
Description copied from class:LoggerAdapterLogs anINFOmessage.- Specified by:
infoin classLoggerAdapter
-
config
Description copied from class:LoggerAdapterLogs anCONFIGmessage.- Specified by:
configin classLoggerAdapter
-
fine
Description copied from class:LoggerAdapterLogs aFINEmessage.- Specified by:
finein classLoggerAdapter
-
finer
Description copied from class:LoggerAdapterLogs aFINERmessage.- Specified by:
finerin classLoggerAdapter
-
finest
Description copied from class:LoggerAdapterLogs aFINESTmessage.- Specified by:
finestin classLoggerAdapter
-
log
Logs a record at the specified level, passing the provided throwable to slf4j api..- Overrides:
login classLoggerAdapter
-