org.springframework.boot.logging

Class AbstractLoggingSystem

    • Field Detail

      • CONFIGURATION_COMPARATOR

        protected static final java.util.Comparator<LoggerConfiguration> CONFIGURATION_COMPARATOR
    • Constructor Detail

      • AbstractLoggingSystem

        public AbstractLoggingSystem(java.lang.ClassLoader classLoader)
    • Method Detail

      • initialize

        public void initialize(LoggingInitializationContext initializationContext,
                               java.lang.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 java.lang.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 java.lang.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 java.lang.String[] getStandardConfigLocations()
        Return the standard config locations for this system.
        Returns:
        the standard config locations
        See Also:
        getSelfInitializationConfig()
      • getSpringConfigLocations

        protected java.lang.String[] getSpringConfigLocations()
        Return the spring config locations for this system. By default this method returns a set of locations based on getStandardConfigLocations().
        Returns:
        the spring config locations
        See Also:
        getSpringInitializationConfig()
      • 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,
                                                  java.lang.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 java.lang.ClassLoader getClassLoader()
      • getPackagedConfigFile

        protected final java.lang.String getPackagedConfigFile(java.lang.String fileName)
      • applySystemProperties

        protected final void applySystemProperties(org.springframework.core.env.Environment environment,
                                                   LogFile logFile)