org.springframework.boot.logging

Class AbstractLoggingSystem

    • Constructor Detail

      • AbstractLoggingSystem

        public AbstractLoggingSystem(ClassLoader classLoader)
    • Method Detail

      • initialize

        public void initialize(LoggingInitializationContext initializationContext,
                               String configLocation,
                               LogFile logFile)
        Description copied from class: LoggingSystem
        Fully initialize the logging system.
        Overrides:
        initialize in class LoggingSystem
        Parameters:
        initializationContext - the logging initialization context
        configLocation - a log configuration location or null if default initialization is required
        logFile - the log output file that should be written or null for console only output
      • getSelfInitializationConfig

        protected String getSelfInitializationConfig()
        Return any self initialization config that has been applied. By default this method checks getStandardConfigLocations() and assumes that any file that exists will have been applied.
        Returns:
        the self initialization config or null
      • getSpringInitializationConfig

        protected String getSpringInitializationConfig()
        Return any spring specific initialization config that should be applied. By default this method checks getSpringConfigLocations().
        Returns:
        the spring initialization config or null
      • getStandardConfigLocations

        protected abstract String[] getStandardConfigLocations()
        Return the standard config locations for this system.
        Returns:
        the standard config locations
        See Also:
        getSelfInitializationConfig()
      • loadDefaults

        protected abstract void loadDefaults(LoggingInitializationContext initializationContext,
                                             LogFile logFile)
        Load sensible defaults for the logging system.
        Parameters:
        initializationContext - the logging initialization context
        logFile - the file to load or null if no log file is to be written
      • loadConfiguration

        protected abstract void loadConfiguration(LoggingInitializationContext initializationContext,
                                                  String location,
                                                  LogFile logFile)
        Load a specific configuration.
        Parameters:
        initializationContext - the logging initialization context
        location - the location of the configuration to load (never null)
        logFile - the file to load or null if no log file is to be written
      • reinitialize

        protected void reinitialize(LoggingInitializationContext initializationContext)
        Reinitialize the logging system if required. Called when getSelfInitializationConfig() is used and the log file hasn't changed. May be used to reload configuration (for example to pick up additional System properties).
        Parameters:
        initializationContext - the logging initialization context
      • getClassLoader

        protected final ClassLoader getClassLoader()
      • getPackagedConfigFile

        protected final String getPackagedConfigFile(String fileName)
      • applySystemProperties

        protected final void applySystemProperties(Environment environment,
                                                   LogFile logFile)