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 SummaryFieldsModifier 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 SummaryConstructorsConstructorDescriptionLoggingSystemProperties(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 SummaryModifier 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_KEYDeprecated, 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_WORDDeprecated, 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_FILEDeprecated, 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_PATHDeprecated, 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_PATTERNDeprecated, 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_CHARSETDeprecated, 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_THRESHOLDDeprecated, 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_PATTERNDeprecated, 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_CHARSETDeprecated, 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_THRESHOLDDeprecated, 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_PATTERNDeprecated, 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_PATTERNDeprecated, 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- 
LoggingSystemPropertiesCreate a newLoggingSystemPropertiesinstance.- Parameters:
- environment- the source environment
 
- 
LoggingSystemPropertiesCreate a newLoggingSystemPropertiesinstance.- Parameters:
- environment- the source environment
- setter- setter used to apply the property or- nullfor system properties
- Since:
- 2.4.2
 
- 
LoggingSystemPropertiespublic LoggingSystemProperties(Environment environment, Function<String, String> defaultValueResolver, BiConsumer<String, String> setter) Create a newLoggingSystemPropertiesinstance.- Parameters:
- environment- the source environment
- defaultValueResolver- function used to resolve default values or- null
- setter- setter used to apply the property or- nullfor system properties
- Since:
- 3.2.0
 
 
- 
- 
Method Details- 
getDefaultCharset
- 
applypublic 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 value
- systemPropertyName- the system property name
- propertyName- 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 value
- systemPropertyName- the system property name
- propertyName- the application property name
- defaultValue- the default value if none can be resolved
 
- 
setSystemPropertySet a system property.- Parameters:
- name- the property name
- value- the value
 
 
- 
LoggingSystemProperty.getEnvironmentVariableName()onLoggingSystemProperty.CONSOLE_CHARSET