Class LoggingSystemProperties
java.lang.Object
org.springframework.boot.logging.LoggingSystemProperties
- Direct Known Subclasses:
LogbackLoggingSystemProperties
Utility to set system properties that can later be used by log configuration files.
- Since:
- 2.0.0
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionLoggingSystemProperties(org.springframework.core.env.Environment environment) Create a newLoggingSystemPropertiesinstance.LoggingSystemProperties(org.springframework.core.env.Environment environment, @Nullable BiConsumer<String, String> setter) Create a newLoggingSystemPropertiesinstance.LoggingSystemProperties(org.springframework.core.env.Environment environment, @Nullable Function<@Nullable String, @Nullable String> defaultValueResolver, @Nullable BiConsumer<String, String> setter) Create a newLoggingSystemPropertiesinstance. -
Method Summary
Modifier and TypeMethodDescriptionfinal voidapply()final voidprotected voidprotected @Nullable ConsoleReturns theConsoleto use.protected CharsetReturns the default console charset.protected CharsetReturns the default file charset.protected final voidsetSystemProperty(String name, @Nullable String value) Set a system property.
-
Constructor Details
-
LoggingSystemProperties
public LoggingSystemProperties(org.springframework.core.env.Environment environment) Create a newLoggingSystemPropertiesinstance.- Parameters:
environment- the source environment
-
LoggingSystemProperties
public LoggingSystemProperties(org.springframework.core.env.Environment environment, @Nullable BiConsumer<String, String> setter) Create a newLoggingSystemPropertiesinstance.- Parameters:
environment- the source environmentsetter- setter used to apply the property ornullfor system properties- Since:
- 2.4.2
-
LoggingSystemProperties
public LoggingSystemProperties(org.springframework.core.env.Environment environment, @Nullable Function<@Nullable String, @Nullable String> defaultValueResolver, @Nullable BiConsumer<String, String> setter) Create a newLoggingSystemPropertiesinstance.- Parameters:
environment- the source environmentdefaultValueResolver- function used to resolve default values ornullsetter- setter used to apply the property ornullfor system properties- Since:
- 3.2.0
-
-
Method Details
-
getConsole
-
apply
public final void apply() -
apply
-
apply
protected void apply(@Nullable LogFile logFile, org.springframework.core.env.PropertyResolver resolver) -
getDefaultConsoleCharset
Returns the default console charset.- Returns:
- the default console charset
- Since:
- 3.5.0
-
getDefaultFileCharset
Returns the default file charset.- Returns:
- the default file charset
- Since:
- 3.5.0
-
setSystemProperty
-