Package org.springframework.boot.logging
Class AbstractLoggingSystem
java.lang.Object
org.springframework.boot.logging.LoggingSystem
org.springframework.boot.logging.AbstractLoggingSystem
- Direct Known Subclasses:
- JavaLoggingSystem,- Log4J2LoggingSystem,- LogbackLoggingSystem
Abstract base class for 
LoggingSystem implementations.- Since:
- 1.0.0
- Author:
- Phillip Webb, Dave Syer
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionprotected static classMaintains a mapping between native levels andLogLevel.
- 
Field SummaryFieldsFields inherited from class org.springframework.boot.logging.LoggingSystemNONE, ROOT_LOGGER_NAME, SYSTEM_PROPERTY
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionprotected final voidapplySystemProperties(Environment environment, LogFile logFile) voidReset the logging system to be limit output.protected final ClassLoaderprotected final StringgetPackagedConfigFile(String fileName) protected StringReturn any self initialization config that has been applied.protected String[]Return the spring config locations for this system.protected StringReturn any spring specific initialization config that should be applied.protected abstract String[]Return the standard config locations for this system.voidinitialize(LoggingInitializationContext initializationContext, String configLocation, LogFile logFile) Fully initialize the logging system.protected abstract voidloadConfiguration(LoggingInitializationContext initializationContext, String location, LogFile logFile) Load a specific configuration.protected abstract voidloadDefaults(LoggingInitializationContext initializationContext, LogFile logFile) Load sensible defaults for the logging system.protected voidreinitialize(LoggingInitializationContext initializationContext) Reinitialize the logging system if required.Methods inherited from class org.springframework.boot.logging.LoggingSystemcleanUp, get, getLoggerConfiguration, getLoggerConfigurations, getShutdownHandler, getSupportedLogLevels, getSystemProperties, setLogLevel
- 
Field Details- 
CONFIGURATION_COMPARATOR
 
- 
- 
Constructor Details- 
AbstractLoggingSystem
 
- 
- 
Method Details- 
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.- Specified by:
- beforeInitializein class- LoggingSystem
 
- 
initializepublic void initialize(LoggingInitializationContext initializationContext, String configLocation, LogFile logFile) Description copied from class:LoggingSystemFully initialize the logging system.- Overrides:
- initializein class- LoggingSystem
- 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
 
- 
getSelfInitializationConfigReturn any self initialization config that has been applied. By default this method checksgetStandardConfigLocations()and assumes that any file that exists will have been applied.- Returns:
- the self initialization config or null
 
- 
getSpringInitializationConfigReturn any spring specific initialization config that should be applied. By default this method checksgetSpringConfigLocations().- Returns:
- the spring initialization config or null
 
- 
getStandardConfigLocationsReturn the standard config locations for this system.- Returns:
- the standard config locations
- See Also:
 
- 
getSpringConfigLocationsReturn the spring config locations for this system. By default this method returns a set of locations based ongetStandardConfigLocations().- Returns:
- the spring config locations
- See Also:
 
- 
loadDefaultsprotected abstract void loadDefaults(LoggingInitializationContext initializationContext, LogFile logFile) Load sensible defaults for the logging system.- Parameters:
- initializationContext- the logging initialization context
- logFile- the file to load or- nullif no log file is to be written
 
- 
loadConfigurationprotected abstract void loadConfiguration(LoggingInitializationContext initializationContext, String location, LogFile logFile) Load a specific configuration.- 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
 
- 
reinitializeReinitialize the logging system if required. Called whengetSelfInitializationConfig()is used and the log file hasn't changed. May be used to reload configuration (for example to pick up additional System properties).- Parameters:
- initializationContext- the logging initialization context
 
- 
getClassLoader
- 
getPackagedConfigFile
- 
applySystemProperties
 
-