类 AbstractLoggingSystem

java.lang.Object
org.springframework.boot.logging.LoggingSystem
org.springframework.boot.logging.AbstractLoggingSystem
直接已知子类:
JavaLoggingSystem, Log4J2LoggingSystem, LogbackLoggingSystem

public abstract class AbstractLoggingSystem extends LoggingSystem
Abstract base class for LoggingSystem implementations.
从以下版本开始:
1.0.0
作者:
Phillip Webb, Dave Syer
  • 字段详细资料

  • 构造器详细资料

    • AbstractLoggingSystem

      public AbstractLoggingSystem(ClassLoader classLoader)
  • 方法详细资料

    • beforeInitialize

      public void beforeInitialize()
      从类复制的说明: LoggingSystem
      Reset the logging system to be limit output. This method may be called before LoggingSystem.initialize(LoggingInitializationContext, String, LogFile) to reduce logging noise until the system has been fully initialized.
      指定者:
      beforeInitialize 在类中 LoggingSystem
    • initialize

      public void initialize(LoggingInitializationContext initializationContext, String configLocation, LogFile logFile)
      从类复制的说明: LoggingSystem
      Fully initialize the logging system.
      覆盖:
      initialize 在类中 LoggingSystem
      参数:
      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.
      返回:
      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().
      返回:
      the spring initialization config or null
    • getStandardConfigLocations

      protected abstract String[] getStandardConfigLocations()
      Return the standard config locations for this system.
      返回:
      the standard config locations
      另请参阅:
    • getSpringConfigLocations

      protected String[] getSpringConfigLocations()
      Return the spring config locations for this system. By default this method returns a set of locations based on getStandardConfigLocations().
      返回:
      the spring config locations
      另请参阅:
    • loadDefaults

      protected abstract void loadDefaults(LoggingInitializationContext initializationContext, LogFile logFile)
      Load sensible defaults for the logging system.
      参数:
      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.
      参数:
      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).
      参数:
      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)
    • getDefaultValueResolver

      protected Function<String,String> getDefaultValueResolver(Environment environment)
      Return the default value resolver to use when resolving system properties.
      参数:
      environment - the environment
      返回:
      the default value resolver
      从以下版本开始:
      3.2.0
    • getDefaultLogCorrelationPattern

      protected String getDefaultLogCorrelationPattern()
      Return the default log correlation pattern or null if log correlation patterns are not supported.
      返回:
      the default log correlation pattern
      从以下版本开始:
      3.2.0