public abstract class AbstractLoggingSystem extends LoggingSystem
LoggingSystem
implementations.NONE, SYSTEM_PROPERTY
Constructor and Description |
---|
AbstractLoggingSystem(ClassLoader classLoader) |
Modifier and Type | Method and Description |
---|---|
protected void |
applySystemProperties(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.
|
cleanUp, get, getShutdownHandler, setLogLevel
public AbstractLoggingSystem(ClassLoader classLoader)
public void beforeInitialize()
LoggingSystem
LoggingSystem.initialize(LoggingInitializationContext, String, LogFile)
to reduce
logging noise until the system has been fully initialized.beforeInitialize
in class LoggingSystem
public void initialize(LoggingInitializationContext initializationContext, String configLocation, LogFile logFile)
LoggingSystem
initialize
in class LoggingSystem
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 outputprotected String getSelfInitializationConfig()
getStandardConfigLocations()
and assumes that any file that exists
will have been applied.null
protected String getSpringInitializationConfig()
getSpringConfigLocations()
.null
protected abstract String[] getStandardConfigLocations()
getSelfInitializationConfig()
protected String[] getSpringConfigLocations()
getStandardConfigLocations()
.getSpringInitializationConfig()
protected abstract void loadDefaults(LoggingInitializationContext initializationContext, LogFile logFile)
initializationContext
- the logging initialization contextlogFile
- the file to load or null
if no log file is to be writtenprotected abstract void loadConfiguration(LoggingInitializationContext initializationContext, String location, LogFile logFile)
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 writtenprotected void reinitialize(LoggingInitializationContext initializationContext)
getSelfInitializationConfig()
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 contextprotected final ClassLoader getClassLoader()
protected final void applySystemProperties(Environment environment, LogFile logFile)
Copyright © 2017 Pivotal Software, Inc.. All rights reserved.