Package org.springframework.boot.logging
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
- Author:
- Andy Wilkinson, Phillip Webb, Madhura Bhave, Vedran Pavic, Robert Thornton, EddĂș MelĂ©ndez, Jonatan Ivanov
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionLoggingSystemProperties(Environment environment) Create a newLoggingSystemPropertiesinstance.LoggingSystemProperties(Environment environment, BiConsumer<String, String> setter) Create a newLoggingSystemPropertiesinstance.LoggingSystemProperties(Environment environment, Function<String, String> defaultValueResolver, BiConsumer<String, String> setter) Create a newLoggingSystemPropertiesinstance. -
Method Summary
Modifier and TypeMethodDescriptionfinal voidapply()final voidprotected voidapply(LogFile logFile, PropertyResolver resolver) protected ConsoleReturns theConsoleto use.protected CharsetDeprecated, for removal: This API element is subject to removal in a future version.protected CharsetReturns the default console charset.protected CharsetReturns the default file charset.protected final voidsetSystemProperty(String name, String value) Set a system property.
-
Constructor Details
-
LoggingSystemProperties
Create a newLoggingSystemPropertiesinstance.- Parameters:
environment- the source environment
-
LoggingSystemProperties
Create a newLoggingSystemPropertiesinstance.- Parameters:
environment- the source environmentsetter- setter used to apply the property ornullfor system properties- Since:
- 2.4.2
-
LoggingSystemProperties
public LoggingSystemProperties(Environment environment, Function<String, String> defaultValueResolver, 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
Returns theConsoleto use.- Returns:
- the
Consoleto use - Since:
- 3.5.0
-
apply
public final void apply() -
apply
-
apply
-
getDefaultCharset
Deprecated, for removal: This API element is subject to removal in a future version.since 3.5.0 for removal in 4.0.0 in favor ofgetDefaultConsoleCharset()andgetDefaultFileCharset().Returns the default charset.- Returns:
- the default charset
-
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
Set a system property.- Parameters:
name- the property namevalue- the value
-
getDefaultConsoleCharset()andgetDefaultFileCharset().