public abstract class LoggingSystem
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
NONE
The value of the
SYSTEM_PROPERTY that can be used to indicate that no
LoggingSystem should be used. |
static java.lang.String |
ROOT_LOGGER_NAME
The name used for the root logger.
|
static java.lang.String |
SYSTEM_PROPERTY
A System property that can be used to indicate the
LoggingSystem to use. |
| Constructor and Description |
|---|
LoggingSystem() |
| Modifier and Type | Method and Description |
|---|---|
abstract void |
beforeInitialize()
Reset the logging system to be limit output.
|
void |
cleanUp()
Clean up the logging system.
|
static LoggingSystem |
get(java.lang.ClassLoader classLoader)
Detect and return the logging system in use.
|
LoggerConfiguration |
getLoggerConfiguration(java.lang.String loggerName)
Returns the current configuration for a
LoggingSystem's logger. |
java.util.List<LoggerConfiguration> |
getLoggerConfigurations()
Returns a collection of the current configuration for all a
LoggingSystem's
loggers. |
java.lang.Runnable |
getShutdownHandler()
Returns a
Runnable that can handle shutdown of this logging system when the
JVM exits. |
java.util.Set<LogLevel> |
getSupportedLogLevels()
Returns a set of the
LogLevels that are actually supported by the
logging system. |
LoggingSystemProperties |
getSystemProperties(org.springframework.core.env.ConfigurableEnvironment environment)
Return the
LoggingSystemProperties that should be applied. |
void |
initialize(LoggingInitializationContext initializationContext,
java.lang.String configLocation,
LogFile logFile)
Fully initialize the logging system.
|
void |
setLogLevel(java.lang.String loggerName,
LogLevel level)
Sets the logging level for a given logger.
|
public static final java.lang.String SYSTEM_PROPERTY
LoggingSystem to use.public static final java.lang.String NONE
SYSTEM_PROPERTY that can be used to indicate that no
LoggingSystem should be used.public static final java.lang.String ROOT_LOGGER_NAME
public LoggingSystemProperties getSystemProperties(org.springframework.core.env.ConfigurableEnvironment environment)
LoggingSystemProperties that should be applied.environment - the ConfigurableEnvironment used to obtain valueLoggingSystemProperties to applypublic abstract void beforeInitialize()
initialize(LoggingInitializationContext, String, LogFile) to reduce
logging noise until the system has been fully initialized.public void initialize(LoggingInitializationContext initializationContext, java.lang.String configLocation, LogFile logFile)
initializationContext - the logging initialization contextconfigLocation - a log configuration location or null if default
initialization is requiredlogFile - the log output file that should be written or null for
console only outputpublic void cleanUp()
public java.lang.Runnable getShutdownHandler()
Runnable that can handle shutdown of this logging system when the
JVM exits. The default implementation returns null, indicating that no
shutdown is required.nullpublic java.util.Set<LogLevel> getSupportedLogLevels()
LogLevels that are actually supported by the
logging system.public void setLogLevel(java.lang.String loggerName,
LogLevel level)
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)public java.util.List<LoggerConfiguration> getLoggerConfigurations()
LoggingSystem's
loggers.public LoggerConfiguration getLoggerConfiguration(java.lang.String loggerName)
LoggingSystem's logger.loggerName - the name of the loggerpublic static LoggingSystem get(java.lang.ClassLoader classLoader)
classLoader - the classloader