Class LoggingSystemProperties

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

public class LoggingSystemProperties extends Object
Utility to set system properties that can later be used by log configuration files.
Since:
2.0.0
Author:
Andy Wilkinson, Phillip Webb, Madhura Bhave, Vedran Pavic, Robert Thornton, EddĂș MelĂ©ndez, Jonatan Ivanov
See Also:
  • Constructor Details

    • LoggingSystemProperties

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

      public LoggingSystemProperties(Environment environment, BiConsumer<String,String> setter)
      Create a new LoggingSystemProperties instance.
      Parameters:
      environment - the source environment
      setter - setter used to apply the property or null for system properties
      Since:
      2.4.2
    • LoggingSystemProperties

      public LoggingSystemProperties(Environment environment, Function<String,String> defaultValueResolver, BiConsumer<String,String> setter)
      Create a new LoggingSystemProperties instance.
      Parameters:
      environment - the source environment
      defaultValueResolver - function used to resolve default values or null
      setter - setter used to apply the property or null for system properties
      Since:
      3.2.0
  • Method Details

    • getDefaultCharset

      protected Charset getDefaultCharset()
    • apply

      public final void apply()
    • apply

      public final void apply(LogFile logFile)
    • apply

      protected void apply(LogFile logFile, PropertyResolver resolver)
    • setSystemProperty

      protected final void setSystemProperty(String name, String value)
      Set a system property.
      Parameters:
      name - the property name
      value - the value