Class JavaLoggingSystem
java.lang.Object
org.springframework.boot.logging.LoggingSystem
org.springframework.boot.logging.AbstractLoggingSystem
org.springframework.boot.logging.java.JavaLoggingSystem
- Since:
- 1.0.0
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
LoggingSystemFactory
that returnsJavaLoggingSystem
if possible.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
EXPECT_CORRELATION_ID_PROPERTY, NONE, ROOT_LOGGER_NAME, SYSTEM_PROPERTY
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Reset the logging system to be limit output.void
cleanUp()
Clean up the logging system.getLoggerConfiguration
(String loggerName) Returns the current configuration for aLoggingSystem
's logger.Returns a collection of the current configuration for all aLoggingSystem
's loggers.Returns aRunnable
that 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 theLogLevels
that are actually supported by the logging system.protected void
loadConfiguration
(String location, LogFile logFile) protected void
loadConfiguration
(LoggingInitializationContext initializationContext, String location, LogFile logFile) Load a specific configuration.protected void
loadDefaults
(LoggingInitializationContext initializationContext, LogFile logFile) Load sensible defaults for the logging system.void
setLogLevel
(String loggerName, LogLevel level) Sets the logging level for a given logger.Methods inherited from class org.springframework.boot.logging.AbstractLoggingSystem
applySystemProperties, getClassLoader, getDefaultLogCorrelationPattern, getDefaultValueResolver, getPackagedConfigFile, getSelfInitializationConfig, getSpringConfigLocations, getSpringInitializationConfig, initialize, reinitialize
Methods inherited from class org.springframework.boot.logging.LoggingSystem
get, getSystemProperties
-
Constructor Details
-
JavaLoggingSystem
-
-
Method Details
-
getStandardConfigLocations
Description copied from class:AbstractLoggingSystem
Return the standard config locations for this system.- Specified by:
getStandardConfigLocations
in classAbstractLoggingSystem
- Returns:
- the standard config locations
- See Also:
-
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
-
loadDefaults
Description copied from class:AbstractLoggingSystem
Load sensible defaults for the logging system.- Specified by:
loadDefaults
in classAbstractLoggingSystem
- Parameters:
initializationContext
- the logging initialization contextlogFile
- the file to load ornull
if no log file is to be written
-
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
-
loadConfiguration
-
getSupportedLogLevels
Description copied from class:LoggingSystem
Returns a set of theLogLevels
that are actually supported by the logging system.- Overrides:
getSupportedLogLevels
in classLoggingSystem
- Returns:
- the supported levels
-
setLogLevel
Description copied from class:LoggingSystem
Sets the logging level for a given logger.- Overrides:
setLogLevel
in classLoggingSystem
- Parameters:
loggerName
- the name of the logger to set (null
can be used for the root logger).level
- the log level (null
can be used to remove any custom level for the logger and use the default configuration instead)
-
getLoggerConfigurations
Description copied from class:LoggingSystem
Returns a collection of the current configuration for all aLoggingSystem
's loggers.- Overrides:
getLoggerConfigurations
in classLoggingSystem
- Returns:
- the current configurations
-
getLoggerConfiguration
Description copied from class:LoggingSystem
Returns the current configuration for aLoggingSystem
's logger.- Overrides:
getLoggerConfiguration
in classLoggingSystem
- Parameters:
loggerName
- the name of the logger- Returns:
- the current configuration
-
getShutdownHandler
Description copied from class:LoggingSystem
Returns aRunnable
that can handle shutdown of this logging system when the JVM exits. The default implementation returnsnull
, indicating that no shutdown is required.- Overrides:
getShutdownHandler
in classLoggingSystem
- Returns:
- the shutdown handler, or
null
-
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
-