Class LogbackLoggingSystem
java.lang.Object
org.springframework.boot.logging.LoggingSystem
org.springframework.boot.logging.AbstractLoggingSystem
org.springframework.boot.logging.logback.LogbackLoggingSystem
- All Implemented Interfaces:
- org.springframework.beans.factory.aot.BeanFactoryInitializationAotProcessor
public class LogbackLoggingSystem
extends AbstractLoggingSystem
implements org.springframework.beans.factory.aot.BeanFactoryInitializationAotProcessor
LoggingSystem for logback.- Since:
- 1.0.0
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionstatic classLoggingSystemFactorythat returnsLogbackLoggingSystemif possible.Nested classes/interfaces inherited from class org.springframework.boot.logging.AbstractLoggingSystemAbstractLoggingSystem.LogLevels<T>
- 
Field SummaryFields inherited from class org.springframework.boot.logging.AbstractLoggingSystemCONFIGURATION_COMPARATORFields inherited from class org.springframework.boot.logging.LoggingSystemEXPECT_CORRELATION_ID_PROPERTY, NONE, ROOT_LOGGER_NAME, SYSTEM_PROPERTY
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoidReset the logging system to be limit output.voidcleanUp()Clean up the logging system.protected StringReturn the default log correlation pattern ornullif log correlation patterns are not supported.getLoggerConfiguration(String loggerName) Returns the current configuration for aLoggingSystem's logger.Returns a collection of the current configuration for all aLoggingSystem's loggers.Returns aRunnablethat can handle shutdown of this logging system when the JVM exits.protected String[]Return the standard config locations for this system.Returns a set of theLogLevelsthat are actually supported by the logging system.getSystemProperties(org.springframework.core.env.ConfigurableEnvironment environment) Return theLoggingSystemPropertiesthat should be applied.voidinitialize(LoggingInitializationContext initializationContext, String configLocation, LogFile logFile) Fully initialize the logging system.protected voidloadConfiguration(LoggingInitializationContext initializationContext, String location, LogFile logFile) Load a specific configuration.protected voidloadDefaults(LoggingInitializationContext initializationContext, LogFile logFile) Load sensible defaults for the logging system.org.springframework.beans.factory.aot.BeanFactoryInitializationAotContributionprocessAheadOfTime(org.springframework.beans.factory.config.ConfigurableListableBeanFactory beanFactory) protected voidreinitialize(LoggingInitializationContext initializationContext) Reinitialize the logging system if required.voidsetLogLevel(String loggerName, LogLevel level) Sets the logging level for a given logger.Methods inherited from class org.springframework.boot.logging.AbstractLoggingSystemapplySystemProperties, getClassLoader, getDefaultValueResolver, getPackagedConfigFile, getSelfInitializationConfig, getSpringConfigLocations, getSpringInitializationConfigMethods inherited from class org.springframework.boot.logging.LoggingSystemget
- 
Constructor Details- 
LogbackLoggingSystem
 
- 
- 
Method Details- 
getSystemPropertiespublic LoggingSystemProperties getSystemProperties(org.springframework.core.env.ConfigurableEnvironment environment) Description copied from class:LoggingSystemReturn theLoggingSystemPropertiesthat should be applied.- Overrides:
- getSystemPropertiesin class- LoggingSystem
- Parameters:
- environment- the- ConfigurableEnvironmentused to obtain value
- Returns:
- the LoggingSystemPropertiesto apply
 
- 
getStandardConfigLocationsDescription copied from class:AbstractLoggingSystemReturn the standard config locations for this system.- Specified by:
- getStandardConfigLocationsin class- AbstractLoggingSystem
- Returns:
- the standard config locations
- See Also:
 
- 
beforeInitializepublic void beforeInitialize()Description copied from class:LoggingSystemReset 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:
- beforeInitializein class- AbstractLoggingSystem
 
- 
initializepublic void initialize(LoggingInitializationContext initializationContext, String configLocation, LogFile logFile) Description copied from class:LoggingSystemFully initialize the logging system.- Overrides:
- initializein class- AbstractLoggingSystem
- Parameters:
- initializationContext- the logging initialization context
- configLocation- a log configuration location or- nullif default initialization is required
- logFile- the log output file that should be written or- nullfor console only output
 
- 
loadDefaultsDescription copied from class:AbstractLoggingSystemLoad sensible defaults for the logging system.- Specified by:
- loadDefaultsin class- AbstractLoggingSystem
- Parameters:
- initializationContext- the logging initialization context
- logFile- the file to load or- nullif no log file is to be written
 
- 
loadConfigurationprotected void loadConfiguration(LoggingInitializationContext initializationContext, String location, LogFile logFile) Description copied from class:AbstractLoggingSystemLoad a specific configuration.- Specified by:
- loadConfigurationin class- AbstractLoggingSystem
- Parameters:
- initializationContext- the logging initialization context
- location- the location of the configuration to load (never- null)
- logFile- the file to load or- nullif no log file is to be written
 
- 
cleanUppublic void cleanUp()Description copied from class:LoggingSystemClean up the logging system. The default implementation does nothing. Subclasses should override this method to perform any logging system-specific cleanup.- Overrides:
- cleanUpin class- LoggingSystem
 
- 
reinitializeDescription copied from class:AbstractLoggingSystemReinitialize the logging system if required. Called whenAbstractLoggingSystem.getSelfInitializationConfig()is used and the log file hasn't changed. May be used to reload configuration (for example to pick up additional System properties).- Overrides:
- reinitializein class- AbstractLoggingSystem
- Parameters:
- initializationContext- the logging initialization context
 
- 
getLoggerConfigurationsDescription copied from class:LoggingSystemReturns a collection of the current configuration for all aLoggingSystem's loggers.- Overrides:
- getLoggerConfigurationsin class- LoggingSystem
- Returns:
- the current configurations
 
- 
getLoggerConfigurationDescription copied from class:LoggingSystemReturns the current configuration for aLoggingSystem's logger.- Overrides:
- getLoggerConfigurationin class- LoggingSystem
- Parameters:
- loggerName- the name of the logger
- Returns:
- the current configuration
 
- 
getSupportedLogLevelsDescription copied from class:LoggingSystemReturns a set of theLogLevelsthat are actually supported by the logging system.- Overrides:
- getSupportedLogLevelsin class- LoggingSystem
- Returns:
- the supported levels
 
- 
setLogLevelDescription copied from class:LoggingSystemSets the logging level for a given logger.- Overrides:
- setLogLevelin class- LoggingSystem
- Parameters:
- loggerName- the name of the logger to set (- nullcan be used for the root logger).
- level- the log level (- nullcan be used to remove any custom level for the logger and use the default configuration instead)
 
- 
getShutdownHandlerDescription copied from class:LoggingSystemReturns aRunnablethat can handle shutdown of this logging system when the JVM exits. The default implementation returnsnull, indicating that no shutdown is required.- Overrides:
- getShutdownHandlerin class- LoggingSystem
- Returns:
- the shutdown handler, or null
 
- 
getDefaultLogCorrelationPatternDescription copied from class:AbstractLoggingSystemReturn the default log correlation pattern ornullif log correlation patterns are not supported.- Overrides:
- getDefaultLogCorrelationPatternin class- AbstractLoggingSystem
- Returns:
- the default log correlation pattern
 
- 
processAheadOfTimepublic org.springframework.beans.factory.aot.BeanFactoryInitializationAotContribution processAheadOfTime(org.springframework.beans.factory.config.ConfigurableListableBeanFactory beanFactory) - Specified by:
- processAheadOfTimein interface- org.springframework.beans.factory.aot.BeanFactoryInitializationAotProcessor
 
 
-