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:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringDeprecated, for removal: This API element is subject to removal in a future version.static final StringDeprecated, for removal: This API element is subject to removal in a future version.since 3.2.0 for removal in 3.4.0 in favor of callingLoggingSystemProperty.getEnvironmentVariableName()onLoggingSystemProperty.CONSOLE_PATTERNstatic final StringDeprecated, for removal: This API element is subject to removal in a future version.since 3.2.0 for removal in 3.4.0 in favor of callingLoggingSystemProperty.getEnvironmentVariableName()onLoggingSystemProperty.CONSOLE_THRESHOLDstatic final StringDeprecated, for removal: This API element is subject to removal in a future version.since 3.2.0 for removal in 3.4.0 in favor of callingLoggingSystemProperty.getEnvironmentVariableName()onLoggingSystemProperty.EXCEPTION_CONVERSION_WORDstatic final StringDeprecated, for removal: This API element is subject to removal in a future version.since 3.2.0 for removal in 3.4.0 in favor of callingLoggingSystemProperty.getEnvironmentVariableName()onLoggingSystemProperty.FILE_CHARSETstatic final StringDeprecated, for removal: This API element is subject to removal in a future version.since 3.2.0 for removal in 3.4.0 in favor of callingLoggingSystemProperty.getEnvironmentVariableName()onLoggingSystemProperty.FILE_PATTERNstatic final StringDeprecated, for removal: This API element is subject to removal in a future version.since 3.2.0 for removal in 3.4.0 in favor of callingLoggingSystemProperty.getEnvironmentVariableName()onLoggingSystemProperty.FILE_THRESHOLDstatic final StringDeprecated, for removal: This API element is subject to removal in a future version.since 3.2.0 for removal in 3.4.0 in favor of callingLoggingSystemProperty.getEnvironmentVariableName()onLoggingSystemProperty.DATEFORMAT_PATTERNstatic final StringDeprecated, for removal: This API element is subject to removal in a future version.since 3.2.0 for removal in 3.4.0 in favor of callingLoggingSystemProperty.getEnvironmentVariableName()onLoggingSystemProperty.LOG_FILEstatic final StringDeprecated, for removal: This API element is subject to removal in a future version.since 3.2.0 for removal in 3.4.0 in favor of callingLoggingSystemProperty.getEnvironmentVariableName()onLoggingSystemProperty.LEVEL_PATTERNstatic final StringDeprecated, for removal: This API element is subject to removal in a future version.since 3.2.0 for removal in 3.4.0 in favor of callingLoggingSystemProperty.getEnvironmentVariableName()onLoggingSystemProperty.LOG_PATHstatic final StringDeprecated, for removal: This API element is subject to removal in a future version.since 3.2.0 for removal in 3.4.0 in favor of callingLoggingSystemProperty.getEnvironmentVariableName()onLoggingSystemProperty.PID -
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 Charsetprotected final voidsetSystemProperty(String name, String value) Set a system property.protected final voidsetSystemProperty(PropertyResolver resolver, String systemPropertyName, String propertyName) Deprecated, for removal: This API element is subject to removal in a future version.since 3.2.0 for removal in 3.4.0 with no replacementprotected final voidsetSystemProperty(PropertyResolver resolver, String systemPropertyName, String propertyName, String defaultValue) Deprecated, for removal: This API element is subject to removal in a future version.since 3.2.0 for removal in 3.4.0 with no replacement
-
Field Details
-
PID_KEY
Deprecated, for removal: This API element is subject to removal in a future version.since 3.2.0 for removal in 3.4.0 in favor of callingLoggingSystemProperty.getEnvironmentVariableName()onLoggingSystemProperty.PIDThe name of the System property that contains the process ID. -
EXCEPTION_CONVERSION_WORD
Deprecated, for removal: This API element is subject to removal in a future version.since 3.2.0 for removal in 3.4.0 in favor of callingLoggingSystemProperty.getEnvironmentVariableName()onLoggingSystemProperty.EXCEPTION_CONVERSION_WORDThe name of the System property that contains the exception conversion word. -
LOG_FILE
Deprecated, for removal: This API element is subject to removal in a future version.since 3.2.0 for removal in 3.4.0 in favor of callingLoggingSystemProperty.getEnvironmentVariableName()onLoggingSystemProperty.LOG_FILEThe name of the System property that contains the log file. -
LOG_PATH
Deprecated, for removal: This API element is subject to removal in a future version.since 3.2.0 for removal in 3.4.0 in favor of callingLoggingSystemProperty.getEnvironmentVariableName()onLoggingSystemProperty.LOG_PATHThe name of the System property that contains the log path. -
CONSOLE_LOG_PATTERN
Deprecated, for removal: This API element is subject to removal in a future version.since 3.2.0 for removal in 3.4.0 in favor of callingLoggingSystemProperty.getEnvironmentVariableName()onLoggingSystemProperty.CONSOLE_PATTERNThe name of the System property that contains the console log pattern. -
CONSOLE_LOG_CHARSET
Deprecated, for removal: This API element is subject to removal in a future version.since 3.2.0 for removal in 3.4.0 in favor of callingLoggingSystemProperty.getEnvironmentVariableName()onLoggingSystemProperty.CONSOLE_CHARSETThe name of the System property that contains the console log charset. -
CONSOLE_LOG_THRESHOLD
Deprecated, for removal: This API element is subject to removal in a future version.since 3.2.0 for removal in 3.4.0 in favor of callingLoggingSystemProperty.getEnvironmentVariableName()onLoggingSystemProperty.CONSOLE_THRESHOLDThe log level threshold for console log. -
FILE_LOG_PATTERN
Deprecated, for removal: This API element is subject to removal in a future version.since 3.2.0 for removal in 3.4.0 in favor of callingLoggingSystemProperty.getEnvironmentVariableName()onLoggingSystemProperty.FILE_PATTERNThe name of the System property that contains the file log pattern. -
FILE_LOG_CHARSET
Deprecated, for removal: This API element is subject to removal in a future version.since 3.2.0 for removal in 3.4.0 in favor of callingLoggingSystemProperty.getEnvironmentVariableName()onLoggingSystemProperty.FILE_CHARSETThe name of the System property that contains the file log charset. -
FILE_LOG_THRESHOLD
Deprecated, for removal: This API element is subject to removal in a future version.since 3.2.0 for removal in 3.4.0 in favor of callingLoggingSystemProperty.getEnvironmentVariableName()onLoggingSystemProperty.FILE_THRESHOLDThe log level threshold for file log. -
LOG_LEVEL_PATTERN
Deprecated, for removal: This API element is subject to removal in a future version.since 3.2.0 for removal in 3.4.0 in favor of callingLoggingSystemProperty.getEnvironmentVariableName()onLoggingSystemProperty.LEVEL_PATTERNThe name of the System property that contains the log level pattern. -
LOG_DATEFORMAT_PATTERN
Deprecated, for removal: This API element is subject to removal in a future version.since 3.2.0 for removal in 3.4.0 in favor of callingLoggingSystemProperty.getEnvironmentVariableName()onLoggingSystemProperty.DATEFORMAT_PATTERNThe name of the System property that contains the log date-format pattern.
-
-
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
-
getDefaultCharset
-
apply
public final void apply() -
apply
-
apply
-
setSystemProperty
@Deprecated(since="3.2.0", forRemoval=true) protected final void setSystemProperty(PropertyResolver resolver, String systemPropertyName, String propertyName) Deprecated, for removal: This API element is subject to removal in a future version.since 3.2.0 for removal in 3.4.0 with no replacementSet a system property.- Parameters:
resolver- the resolver used to get the property valuesystemPropertyName- the system property namepropertyName- the application property name
-
setSystemProperty
@Deprecated(since="3.2.0", forRemoval=true) protected final void setSystemProperty(PropertyResolver resolver, String systemPropertyName, String propertyName, String defaultValue) Deprecated, for removal: This API element is subject to removal in a future version.since 3.2.0 for removal in 3.4.0 with no replacementSet a system property.- Parameters:
resolver- the resolver used to get the property valuesystemPropertyName- the system property namepropertyName- the application property namedefaultValue- the default value if none can be resolved
-
setSystemProperty
Set a system property.- Parameters:
name- the property namevalue- the value
-
LoggingSystemProperty.getEnvironmentVariableName()onLoggingSystemProperty.CONSOLE_CHARSET