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
Modifier and TypeFieldDescriptionstatic final String
Deprecated, for removal: This API element is subject to removal in a future version.static final String
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_PATTERN
static final String
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_THRESHOLD
static final String
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_WORD
static final String
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_CHARSET
static final String
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_PATTERN
static final String
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_THRESHOLD
static final String
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_PATTERN
static final String
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_FILE
static final String
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_PATTERN
static final String
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_PATH
static final String
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.PID
-
Constructor Summary
ConstructorDescriptionLoggingSystemProperties
(Environment environment) Create a newLoggingSystemProperties
instance.LoggingSystemProperties
(Environment environment, BiConsumer<String, String> setter) Create a newLoggingSystemProperties
instance.LoggingSystemProperties
(Environment environment, Function<String, String> defaultValueResolver, BiConsumer<String, String> setter) Create a newLoggingSystemProperties
instance. -
Method Summary
Modifier and TypeMethodDescriptionfinal void
apply()
final void
protected void
apply
(LogFile logFile, PropertyResolver resolver) protected Charset
protected final void
setSystemProperty
(String name, String value) Set a system property.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 replacementprotected 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 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.PID
The 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_WORD
The 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_FILE
The 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_PATH
The 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_PATTERN
The 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_CHARSET
The 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_THRESHOLD
The 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_PATTERN
The 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_CHARSET
The 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_THRESHOLD
The 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_PATTERN
The 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_PATTERN
The name of the System property that contains the log date-format pattern.
-
-
Constructor Details
-
LoggingSystemProperties
Create a newLoggingSystemProperties
instance.- Parameters:
environment
- the source environment
-
LoggingSystemProperties
Create a newLoggingSystemProperties
instance.- Parameters:
environment
- the source environmentsetter
- setter used to apply the property ornull
for system properties- Since:
- 2.4.2
-
LoggingSystemProperties
public LoggingSystemProperties(Environment environment, Function<String, String> defaultValueResolver, BiConsumer<String, String> setter) Create a newLoggingSystemProperties
instance.- Parameters:
environment
- the source environmentdefaultValueResolver
- function used to resolve default values ornull
setter
- setter used to apply the property ornull
for 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