Package org.springframework.boot.logging
Class Slf4JLoggingSystem
- java.lang.Object
- org.springframework.boot.logging.LoggingSystem
- org.springframework.boot.logging.AbstractLoggingSystem
- org.springframework.boot.logging.Slf4JLoggingSystem
- Direct Known Subclasses:
Log4J2LoggingSystem
,LogbackLoggingSystem
public abstract class Slf4JLoggingSystem extends AbstractLoggingSystem
Abstract base class forLoggingSystem
implementations that utilize SLF4J.- Since:
- 1.2.0
Nested Class Summary
Nested classes/interfaces inherited from class org.springframework.boot.logging.AbstractLoggingSystem
AbstractLoggingSystem.LogLevels<T>
Field Summary
Fields inherited from class org.springframework.boot.logging.AbstractLoggingSystem
CONFIGURATION_COMPARATOR
Fields inherited from class org.springframework.boot.logging.LoggingSystem
NONE, ROOT_LOGGER_NAME, SYSTEM_PROPERTY
Constructor Summary
Constructors Constructor Description Slf4JLoggingSystem(ClassLoader classLoader)
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
beforeInitialize()
Reset the logging system to be limit output.void
cleanUp()
Clean up the logging system.protected boolean
isBridgeHandlerAvailable()
protected boolean
isBridgeJulIntoSlf4j()
Return whether bridging JUL into SLF4J or not.protected void
loadConfiguration(LoggingInitializationContext initializationContext, String location, LogFile logFile)
Load a specific configuration.Methods inherited from class org.springframework.boot.logging.AbstractLoggingSystem
applySystemProperties, getClassLoader, getPackagedConfigFile, getSelfInitializationConfig, getSpringConfigLocations, getSpringInitializationConfig, getStandardConfigLocations, initialize, loadDefaults, reinitialize
Methods inherited from class org.springframework.boot.logging.LoggingSystem
get, getLoggerConfiguration, getLoggerConfigurations, getShutdownHandler, getSupportedLogLevels, setLogLevel
Constructor Detail
Slf4JLoggingSystem
public Slf4JLoggingSystem(ClassLoader classLoader)
Method Detail
beforeInitialize
public void beforeInitialize()
Description copied from class:LoggingSystem
Reset the logging system to be limit output. This method may be called beforeLoggingSystem.initialize(LoggingInitializationContext, String, LogFile)
to reduce logging noise until the system has been fully initialized.- Overrides:
beforeInitialize
in classAbstractLoggingSystem
cleanUp
public void cleanUp()
Description copied from class:LoggingSystem
Clean up the logging system. The default implementation does nothing. Subclasses should override this method to perform any logging system-specific cleanup.- Overrides:
cleanUp
in classLoggingSystem
loadConfiguration
protected void loadConfiguration(LoggingInitializationContext initializationContext, String location, LogFile logFile)
Description copied from class:AbstractLoggingSystem
Load a specific configuration.- Specified by:
loadConfiguration
in classAbstractLoggingSystem
- Parameters:
initializationContext
- the logging initialization contextlocation
- the location of the configuration to load (nevernull
)logFile
- the file to load ornull
if no log file is to be written
isBridgeJulIntoSlf4j
protected final boolean isBridgeJulIntoSlf4j()
Return whether bridging JUL into SLF4J or not.- Returns:
- whether bridging JUL into SLF4J or not
- Since:
- 2.0.4
isBridgeHandlerAvailable
protected final boolean isBridgeHandlerAvailable()