org.springframework.boot.logging

Class LoggingSystemProperties

  • java.lang.Object
    • org.springframework.boot.logging.LoggingSystemProperties
  • Direct Known Subclasses:
    LogbackLoggingSystemProperties


    public class LoggingSystemProperties
    extends java.lang.Object
    Utility to set system properties that can later be used by log configuration files.
    Since:
    2.0.0
    • Field Summary

      Fields 
      Modifier and Type Field and Description
      static java.lang.String CONSOLE_LOG_CHARSET
      The name of the System property that contains the console log charset.
      static java.lang.String CONSOLE_LOG_PATTERN
      The name of the System property that contains the console log pattern.
      static java.lang.String EXCEPTION_CONVERSION_WORD
      The name of the System property that contains the exception conversion word.
      static java.lang.String FILE_LOG_CHARSET
      The name of the System property that contains the file log charset.
      static java.lang.String FILE_LOG_PATTERN
      The name of the System property that contains the file log pattern.
      static java.lang.String LOG_DATEFORMAT_PATTERN
      The name of the System property that contains the log date-format pattern.
      static java.lang.String LOG_FILE
      The name of the System property that contains the log file.
      static java.lang.String LOG_LEVEL_PATTERN
      The name of the System property that contains the log level pattern.
      static java.lang.String LOG_PATH
      The name of the System property that contains the log path.
      static java.lang.String PID_KEY
      The name of the System property that contains the process ID.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      void apply() 
      void apply(LogFile logFile) 
      protected void apply(LogFile logFile, org.springframework.core.env.PropertyResolver resolver) 
      protected java.nio.charset.Charset getDefaultCharset() 
      protected void setSystemProperty(org.springframework.core.env.PropertyResolver resolver, java.lang.String systemPropertyName, java.lang.String propertyName) 
      protected void setSystemProperty(org.springframework.core.env.PropertyResolver resolver, java.lang.String systemPropertyName, java.lang.String propertyName, java.lang.String defaultValue) 
      protected void setSystemProperty(java.lang.String name, java.lang.String value) 
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • PID_KEY

        public static final java.lang.String PID_KEY
        The name of the System property that contains the process ID.
        See Also:
        Constant Field Values
      • EXCEPTION_CONVERSION_WORD

        public static final java.lang.String EXCEPTION_CONVERSION_WORD
        The name of the System property that contains the exception conversion word.
        See Also:
        Constant Field Values
      • LOG_FILE

        public static final java.lang.String LOG_FILE
        The name of the System property that contains the log file.
        See Also:
        Constant Field Values
      • LOG_PATH

        public static final java.lang.String LOG_PATH
        The name of the System property that contains the log path.
        See Also:
        Constant Field Values
      • CONSOLE_LOG_PATTERN

        public static final java.lang.String CONSOLE_LOG_PATTERN
        The name of the System property that contains the console log pattern.
        See Also:
        Constant Field Values
      • CONSOLE_LOG_CHARSET

        public static final java.lang.String CONSOLE_LOG_CHARSET
        The name of the System property that contains the console log charset.
        See Also:
        Constant Field Values
      • FILE_LOG_PATTERN

        public static final java.lang.String FILE_LOG_PATTERN
        The name of the System property that contains the file log pattern.
        See Also:
        Constant Field Values
      • FILE_LOG_CHARSET

        public static final java.lang.String FILE_LOG_CHARSET
        The name of the System property that contains the file log charset.
        See Also:
        Constant Field Values
      • LOG_LEVEL_PATTERN

        public static final java.lang.String LOG_LEVEL_PATTERN
        The name of the System property that contains the log level pattern.
        See Also:
        Constant Field Values
      • LOG_DATEFORMAT_PATTERN

        public static final java.lang.String LOG_DATEFORMAT_PATTERN
        The name of the System property that contains the log date-format pattern.
        See Also:
        Constant Field Values
    • Constructor Detail

      • LoggingSystemProperties

        public LoggingSystemProperties(org.springframework.core.env.Environment environment)
        Create a new LoggingSystemProperties instance.
        Parameters:
        environment - the source environment
      • LoggingSystemProperties

        public LoggingSystemProperties(org.springframework.core.env.Environment environment,
                                       java.util.function.BiConsumer<java.lang.String,java.lang.String> setter)
        Create a new LoggingSystemProperties instance.
        Parameters:
        environment - the source environment
        setter - setter used to apply the property
        Since:
        2.4.2
    • Method Detail

      • getDefaultCharset

        protected java.nio.charset.Charset getDefaultCharset()
      • apply

        public final void apply()
      • apply

        public final void apply(LogFile logFile)
      • apply

        protected void apply(LogFile logFile,
                             org.springframework.core.env.PropertyResolver resolver)
      • setSystemProperty

        protected final void setSystemProperty(org.springframework.core.env.PropertyResolver resolver,
                                               java.lang.String systemPropertyName,
                                               java.lang.String propertyName)
      • setSystemProperty

        protected final void setSystemProperty(org.springframework.core.env.PropertyResolver resolver,
                                               java.lang.String systemPropertyName,
                                               java.lang.String propertyName,
                                               java.lang.String defaultValue)
      • setSystemProperty

        protected final void setSystemProperty(java.lang.String name,
                                               java.lang.String value)