类 AbstractLoggingSystem
- java.lang.Object
- org.springframework.boot.logging.LoggingSystem
- org.springframework.boot.logging.AbstractLoggingSystem
- 直接已知子类:
JavaLoggingSystem
,Slf4JLoggingSystem
public abstract class AbstractLoggingSystem extends LoggingSystem
Abstract base class forLoggingSystem
implementations.
嵌套类概要
嵌套类 修饰符和类型 类 说明 protected static class
AbstractLoggingSystem.LogLevels<T>
Maintains a mapping between native levels andLogLevel
.
字段概要
字段 修饰符和类型 字段 说明 protected static Comparator<LoggerConfiguration>
CONFIGURATION_COMPARATOR
从类继承的字段 org.springframework.boot.logging.LoggingSystem
NONE, ROOT_LOGGER_NAME, SYSTEM_PROPERTY
构造器概要
构造器 构造器 说明 AbstractLoggingSystem(ClassLoader classLoader)
方法概要
所有方法 实例方法 抽象方法 具体方法 修饰符和类型 方法 说明 protected void
applySystemProperties(org.springframework.core.env.Environment environment, LogFile logFile)
void
beforeInitialize()
Reset the logging system to be limit output.protected ClassLoader
getClassLoader()
protected String
getPackagedConfigFile(String fileName)
protected String
getSelfInitializationConfig()
Return any self initialization config that has been applied.protected String[]
getSpringConfigLocations()
Return the spring config locations for this system.protected String
getSpringInitializationConfig()
Return any spring specific initialization config that should be applied.protected abstract String[]
getStandardConfigLocations()
Return the standard config locations for this system.void
initialize(LoggingInitializationContext initializationContext, String configLocation, LogFile logFile)
Fully initialize the logging system.protected abstract void
loadConfiguration(LoggingInitializationContext initializationContext, String location, LogFile logFile)
Load a specific configuration.protected abstract void
loadDefaults(LoggingInitializationContext initializationContext, LogFile logFile)
Load sensible defaults for the logging system.protected void
reinitialize(LoggingInitializationContext initializationContext)
Reinitialize the logging system if required.从类继承的方法 org.springframework.boot.logging.LoggingSystem
cleanUp, get, getLoggerConfiguration, getLoggerConfigurations, getShutdownHandler, getSupportedLogLevels, setLogLevel
字段详细资料
CONFIGURATION_COMPARATOR
protected static final Comparator<LoggerConfiguration> CONFIGURATION_COMPARATOR
构造器详细资料
AbstractLoggingSystem
public AbstractLoggingSystem(ClassLoader classLoader)
方法详细资料
beforeInitialize
public void beforeInitialize()
从类复制的说明: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.- 指定者:
beforeInitialize
在类中LoggingSystem
initialize
public void initialize(LoggingInitializationContext initializationContext, String configLocation, LogFile logFile)
从类复制的说明:LoggingSystem
Fully initialize the logging system.- 覆盖:
initialize
在类中LoggingSystem
- 参数:
initializationContext
- the logging initialization contextconfigLocation
- a log configuration location ornull
if default initialization is requiredlogFile
- the log output file that should be written ornull
for console only output
getSelfInitializationConfig
protected String getSelfInitializationConfig()
Return any self initialization config that has been applied. By default this method checksgetStandardConfigLocations()
and assumes that any file that exists will have been applied.- 返回:
- the self initialization config or
null
getSpringInitializationConfig
protected String getSpringInitializationConfig()
Return any spring specific initialization config that should be applied. By default this method checksgetSpringConfigLocations()
.- 返回:
- the spring initialization config or
null
getStandardConfigLocations
protected abstract String[] getStandardConfigLocations()
Return the standard config locations for this system.- 返回:
- the standard config locations
- 另请参阅:
getSelfInitializationConfig()
getSpringConfigLocations
protected String[] getSpringConfigLocations()
Return the spring config locations for this system. By default this method returns a set of locations based ongetStandardConfigLocations()
.- 返回:
- the spring config locations
- 另请参阅:
getSpringInitializationConfig()
loadDefaults
protected abstract void loadDefaults(LoggingInitializationContext initializationContext, LogFile logFile)
Load sensible defaults for the logging system.- 参数:
initializationContext
- the logging initialization contextlogFile
- the file to load ornull
if no log file is to be written
loadConfiguration
protected abstract void loadConfiguration(LoggingInitializationContext initializationContext, String location, LogFile logFile)
Load a specific configuration.- 参数:
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
reinitialize
protected void reinitialize(LoggingInitializationContext initializationContext)
Reinitialize 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).- 参数:
initializationContext
- the logging initialization context
getClassLoader
protected final ClassLoader getClassLoader()
getPackagedConfigFile
protected final String getPackagedConfigFile(String fileName)
applySystemProperties
protected final void applySystemProperties(org.springframework.core.env.Environment environment, LogFile logFile)