public class JavaLoggingSystem extends AbstractLoggingSystem
AbstractLoggingSystem.LogLevels<T>
CONFIGURATION_COMPARATOR
NONE, ROOT_LOGGER_NAME, SYSTEM_PROPERTY
Constructor and Description |
---|
JavaLoggingSystem(ClassLoader classLoader) |
Modifier and Type | Method and Description |
---|---|
void |
beforeInitialize()
Reset the logging system to be limit output.
|
LoggerConfiguration |
getLoggerConfiguration(String loggerName)
Returns the current configuration for a
LoggingSystem 's logger. |
List<LoggerConfiguration> |
getLoggerConfigurations()
Returns a collection of the current configuration for all a
LoggingSystem 's
loggers. |
Runnable |
getShutdownHandler()
Returns a
Runnable that can handle shutdown of this logging system when the
JVM exits. |
protected String[] |
getStandardConfigLocations()
Return the standard config locations for this system.
|
Set<LogLevel> |
getSupportedLogLevels()
Returns a set of the
LogLevels that are actually supported by the
logging system. |
protected void |
loadConfiguration(LoggingInitializationContext initializationContext,
String location,
LogFile logFile)
Load a specific configuration.
|
protected void |
loadConfiguration(String location,
LogFile logFile) |
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.
|
applySystemProperties, getClassLoader, getPackagedConfigFile, getSelfInitializationConfig, getSpringConfigLocations, getSpringInitializationConfig, initialize, reinitialize
cleanUp, get
public JavaLoggingSystem(ClassLoader classLoader)
protected String[] getStandardConfigLocations()
AbstractLoggingSystem
getStandardConfigLocations
in class AbstractLoggingSystem
AbstractLoggingSystem.getSelfInitializationConfig()
public void beforeInitialize()
LoggingSystem
LoggingSystem.initialize(LoggingInitializationContext, String, LogFile)
to reduce
logging noise until the system has been fully initialized.beforeInitialize
in class AbstractLoggingSystem
protected void loadDefaults(LoggingInitializationContext initializationContext, LogFile logFile)
AbstractLoggingSystem
loadDefaults
in class AbstractLoggingSystem
initializationContext
- the logging initialization contextlogFile
- the file to load or null
if no log file is to be writtenprotected void loadConfiguration(LoggingInitializationContext initializationContext, String location, LogFile logFile)
AbstractLoggingSystem
loadConfiguration
in class AbstractLoggingSystem
initializationContext
- the logging initialization contextlocation
- the location of the configuration to load (never null
)logFile
- the file to load or null
if no log file is to be writtenpublic Set<LogLevel> getSupportedLogLevels()
LoggingSystem
LogLevels
that are actually supported by the
logging system.getSupportedLogLevels
in class LoggingSystem
public void setLogLevel(String loggerName, LogLevel level)
LoggingSystem
setLogLevel
in class LoggingSystem
loggerName
- the name of the logger to set (null
can be used for the
root logger).level
- the log levelpublic List<LoggerConfiguration> getLoggerConfigurations()
LoggingSystem
LoggingSystem
's
loggers.getLoggerConfigurations
in class LoggingSystem
public LoggerConfiguration getLoggerConfiguration(String loggerName)
LoggingSystem
LoggingSystem
's logger.getLoggerConfiguration
in class LoggingSystem
loggerName
- the name of the loggerpublic Runnable getShutdownHandler()
LoggingSystem
Runnable
that can handle shutdown of this logging system when the
JVM exits. The default implementation returns null
, indicating that no
shutdown is required.getShutdownHandler
in class LoggingSystem
null
Copyright © 2018 Pivotal Software, Inc.. All rights reserved.