Skip to content

Commit 08d0297

Browse files
committed
FEAT - Add standardized property to distinguish a group of applications
- Add a standardized property to provide some indicator that a set of applications are part of a larger "business application" so that they can be viewed in metrics, portals, traces and more #39913 Signed-off-by: Jakob Wanger <[email protected]>
1 parent 9a4d0fb commit 08d0297

File tree

20 files changed

+362
-14
lines changed

20 files changed

+362
-14
lines changed

spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/metrics/export/otlp/OtlpPropertiesConfigAdapter.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,11 @@ class OtlpPropertiesConfigAdapter extends StepRegistryPropertiesConfigAdapter<Ot
4343
*/
4444
private static final String DEFAULT_APPLICATION_NAME = "unknown_service";
4545

46+
/**
47+
* Default value for application group if {@code spring.application.group} is not set.
48+
*/
49+
private static final String DEFAULT_APPLICATION_GROUP = "unknown_group";
50+
4651
private final OpenTelemetryProperties openTelemetryProperties;
4752

4853
private final OtlpMetricsConnectionDetails connectionDetails;
@@ -79,13 +84,18 @@ public Map<String, String> resourceAttributes() {
7984
Map<String, String> result = new HashMap<>((!CollectionUtils.isEmpty(resourceAttributes)) ? resourceAttributes
8085
: get(OtlpProperties::getResourceAttributes, OtlpConfig.super::resourceAttributes));
8186
result.computeIfAbsent("service.name", (key) -> getApplicationName());
87+
result.computeIfAbsent("service.group", (key) -> getApplicationGroup());
8288
return Collections.unmodifiableMap(result);
8389
}
8490

8591
private String getApplicationName() {
8692
return this.environment.getProperty("spring.application.name", DEFAULT_APPLICATION_NAME);
8793
}
8894

95+
private String getApplicationGroup() {
96+
return this.environment.getProperty("spring.application.group", DEFAULT_APPLICATION_GROUP);
97+
}
98+
8999
@Override
90100
public Map<String, String> headers() {
91101
return get(OtlpProperties::getHeaders, OtlpConfig.super::headers);

spring-boot-project/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/opentelemetry/OpenTelemetryAutoConfiguration.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,15 @@ public class OpenTelemetryAutoConfiguration {
5353
*/
5454
private static final String DEFAULT_APPLICATION_NAME = "unknown_service";
5555

56+
/**
57+
* Default value for application group if {@code spring.application.group} is not set.
58+
*/
59+
private static final String DEFAULT_APPLICATION_GROUP = "unknown_group";
60+
5661
private static final AttributeKey<String> ATTRIBUTE_KEY_SERVICE_NAME = AttributeKey.stringKey("service.name");
5762

63+
private static final AttributeKey<String> ATTRIBUTE_KEY_SERVICE_GROUP = AttributeKey.stringKey("service.group");
64+
5865
@Bean
5966
@ConditionalOnMissingBean(OpenTelemetry.class)
6067
OpenTelemetrySdk openTelemetry(ObjectProvider<SdkTracerProvider> tracerProvider,
@@ -72,8 +79,10 @@ OpenTelemetrySdk openTelemetry(ObjectProvider<SdkTracerProvider> tracerProvider,
7279
@ConditionalOnMissingBean
7380
Resource openTelemetryResource(Environment environment, OpenTelemetryProperties properties) {
7481
String applicationName = environment.getProperty("spring.application.name", DEFAULT_APPLICATION_NAME);
82+
String applicationGroup = environment.getProperty("spring.application.group", DEFAULT_APPLICATION_GROUP);
7583
return Resource.getDefault()
7684
.merge(Resource.create(Attributes.of(ATTRIBUTE_KEY_SERVICE_NAME, applicationName)))
85+
.merge(Resource.create(Attributes.of(ATTRIBUTE_KEY_SERVICE_GROUP, applicationGroup)))
7786
.merge(toResource(properties));
7887
}
7988

spring-boot-project/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/metrics/export/otlp/OtlpPropertiesConfigAdapterTests.java

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,32 @@ void shouldUseDefaultApplicationNameIfApplicationNameIsNotSet() {
139139
assertThat(createAdapter().resourceAttributes()).containsEntry("service.name", "unknown_service");
140140
}
141141

142+
@Test
143+
@SuppressWarnings("removal")
144+
void serviceGroupOverridesApplicationGroup() {
145+
this.environment.setProperty("spring.application.group", "alpha");
146+
this.properties.setResourceAttributes(Map.of("service.group", "beta"));
147+
assertThat(createAdapter().resourceAttributes()).containsEntry("service.group", "beta");
148+
}
149+
150+
@Test
151+
void serviceGroupOverridesApplicationGroupWhenUsingOtelProperties() {
152+
this.environment.setProperty("spring.application.group", "alpha");
153+
this.openTelemetryProperties.setResourceAttributes(Map.of("service.group", "beta"));
154+
assertThat(createAdapter().resourceAttributes()).containsEntry("service.group", "beta");
155+
}
156+
157+
@Test
158+
void shouldUseApplicationGroupIfServiceGroupIsNotSet() {
159+
this.environment.setProperty("spring.application.group", "alpha");
160+
assertThat(createAdapter().resourceAttributes()).containsEntry("service.group", "alpha");
161+
}
162+
163+
@Test
164+
void shouldUseDefaultApplicationGroupIfApplicationGroupIsNotSet() {
165+
assertThat(createAdapter().resourceAttributes()).containsEntry("service.group", "unknown_group");
166+
}
167+
142168
private OtlpPropertiesConfigAdapter createAdapter() {
143169
return new OtlpPropertiesConfigAdapter(this.properties, this.openTelemetryProperties, this.connectionDetails,
144170
this.environment);

spring-boot-project/spring-boot-docs/src/docs/asciidoc/actuator/tracing.adoc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,9 +84,10 @@ For example, the following will provide a correlation ID for Logback in format p
8484
pattern:
8585
correlation: "[${spring.application.name:},%X{traceId:-},%X{spanId:-}] "
8686
include-application-name: false
87+
include-application-group: false
8788
----
8889

89-
NOTE: In the example above, configprop:logging.include-application-name[] is set to `false` to avoid the application name being duplicated in the log messages (configprop:logging.pattern.correlation[] already contains it).
90+
NOTE: In the example above, configprop:logging.include-application-name[] and configprop:logging.include-application-group[] is set to `false` to avoid the application name being duplicated in the log messages (configprop:logging.pattern.correlation[] already contains it).
9091
It's also worth mentioning that configprop:logging.pattern.correlation[] contains a trailing space so that it is separated from the logger name that comes right after it by default.
9192

9293

spring-boot-project/spring-boot-docs/src/docs/asciidoc/features/logging.adoc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ The following items are output:
3232
* Process ID.
3333
* A `---` separator to distinguish the start of actual log messages.
3434
* Application name: Enclosed in square brackets (logged by default only if configprop:spring.application.name[] is set)
35+
* Application group: Enclosed in square brackets (logged by default only if configprop:spring.application.group[] is set)
3536
* Thread name: Enclosed in square brackets (may be truncated for console output).
3637
* Correlation ID: If tracing is enabled (not shown in the sample above)
3738
* Logger name: This is usually the source class name (often abbreviated).
@@ -41,6 +42,7 @@ NOTE: Logback does not have a `FATAL` level.
4142
It is mapped to `ERROR`.
4243

4344
TIP: If you have a configprop:spring.application.name[] property but don't want it logged you can set configprop:logging.include-application-name[] to `false`.
45+
TIP: If you have a configprop:spring.application.group[] property but don't want it logged you can set configprop:logging.include-application-group[] to `false`.
4446

4547

4648
[[features.logging.console-output]]
@@ -536,12 +538,13 @@ The following listing shows three sample profiles:
536538
If you want to refer to properties from your Spring `Environment` within your Log4j2 configuration you can use `spring:` prefixed https://logging.apache.org/log4j/2.x/manual/lookups.html[lookups].
537539
Doing so can be useful if you want to access values from your `application.properties` file in your Log4j2 configuration.
538540

539-
The following example shows how to set a Log4j2 property named `applicationName` that reads `spring.application.name` from the Spring `Environment`:
541+
The following example shows how to set a Log4j2 property named `applicationName` and `applicationGroup` that reads `spring.application.name` and `spring.application.group` from the Spring `Environment`:
540542

541543
[source,xml,subs="verbatim",indent=0]
542544
----
543545
<Properties>
544546
<Property name="applicationName">${spring:spring.application.name}</Property>
547+
<Property name="applicationProperty">${spring:spring.application.property}</Property>
545548
</Properties>
546549
----
547550

spring-boot-project/spring-boot-docs/src/docs/asciidoc/howto/properties-and-configuration.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,7 @@ The preceding example YAML corresponds to the following `application.properties`
196196
[source,properties,indent=0,subs="verbatim",configprops]
197197
----
198198
spring.application.name=cruncher
199+
spring.application.group=crunchGroup
199200
spring.datasource.driver-class-name=com.mysql.jdbc.Driver
200201
spring.datasource.url=jdbc:mysql://localhost/test
201202
server.port=9000

spring-boot-project/spring-boot/src/main/java/org/springframework/boot/logging/LoggingSystemProperties.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,7 @@ private PropertyResolver getPropertyResolver() {
229229
protected void apply(LogFile logFile, PropertyResolver resolver) {
230230
String defaultCharsetName = getDefaultCharset().name();
231231
setApplicationNameSystemProperty(resolver);
232+
setApplicationGroupSystemProperty(resolver);
232233
setSystemProperty(LoggingSystemProperty.PID, new ApplicationPid().toString());
233234
setSystemProperty(LoggingSystemProperty.CONSOLE_CHARSET, resolver, defaultCharsetName);
234235
setSystemProperty(LoggingSystemProperty.FILE_CHARSET, resolver, defaultCharsetName);
@@ -255,6 +256,16 @@ private void setApplicationNameSystemProperty(PropertyResolver resolver) {
255256
}
256257
}
257258

259+
private void setApplicationGroupSystemProperty(PropertyResolver resolver) {
260+
if (resolver.getProperty("logging.include-application-group", Boolean.class, Boolean.TRUE)) {
261+
String applicationGroup = resolver.getProperty("spring.application.group");
262+
if (StringUtils.hasText(applicationGroup)) {
263+
setSystemProperty(LoggingSystemProperty.APPLICATION_GROUP.getEnvironmentVariableName(),
264+
"[%s] ".formatted(applicationGroup));
265+
}
266+
}
267+
}
268+
258269
private void setSystemProperty(LoggingSystemProperty property, PropertyResolver resolver) {
259270
setSystemProperty(property, resolver, null);
260271
}

spring-boot-project/spring-boot/src/main/java/org/springframework/boot/logging/LoggingSystemProperty.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,11 @@ public enum LoggingSystemProperty {
3030
*/
3131
APPLICATION_NAME("LOGGED_APPLICATION_NAME"),
3232

33+
/**
34+
* Logging system property for the application group that should be logged.
35+
*/
36+
APPLICATION_GROUP("LOGGED_APPLICATION_GROUP"),
37+
3338
/**
3439
* Logging system property for the process ID.
3540
*/
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
/*
2+
* Copyright 2012-2024 the original author or authors.
3+
*
4+
* Licensed under the Apache License, Version 2.0 (the "License");
5+
* you may not use this file except in compliance with the License.
6+
* You may obtain a copy of the License at
7+
*
8+
* https://www.apache.org/licenses/LICENSE-2.0
9+
*
10+
* Unless required by applicable law or agreed to in writing, software
11+
* distributed under the License is distributed on an "AS IS" BASIS,
12+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
* See the License for the specific language governing permissions and
14+
* limitations under the License.
15+
*/
16+
17+
package org.springframework.boot.logging.logback;
18+
19+
import ch.qos.logback.classic.pattern.ClassicConverter;
20+
import ch.qos.logback.classic.pattern.PropertyConverter;
21+
import ch.qos.logback.classic.spi.ILoggingEvent;
22+
23+
import org.springframework.boot.logging.LoggingSystemProperty;
24+
25+
/**
26+
* Logback {@link ClassicConverter} to convert the
27+
* {@link LoggingSystemProperty#APPLICATION_GROUP APPLICATION_GROUP} into a value suitable
28+
* for logging. Similar to Logback's {@link PropertyConverter} but a non-existent property
29+
* is logged as an empty string rather than {@code null}.
30+
*
31+
* @author Jakob Wanger
32+
* @since 3.4.0
33+
*/
34+
public class ApplicationGroupConverter extends ClassicConverter {
35+
36+
@Override
37+
public String convert(ILoggingEvent event) {
38+
String applicationGroup = event.getLoggerContextVO()
39+
.getPropertyMap()
40+
.get(LoggingSystemProperty.APPLICATION_GROUP.getEnvironmentVariableName());
41+
if (applicationGroup == null) {
42+
applicationGroup = System.getProperty(LoggingSystemProperty.APPLICATION_GROUP.getEnvironmentVariableName());
43+
if (applicationGroup == null) {
44+
applicationGroup = "";
45+
}
46+
}
47+
return applicationGroup;
48+
}
49+
50+
}

spring-boot-project/spring-boot/src/main/java/org/springframework/boot/logging/logback/DefaultLogbackConfiguration.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,14 +69,15 @@ void apply(LogbackConfigurator config) {
6969

7070
private void defaults(LogbackConfigurator config) {
7171
config.conversionRule("applicationName", ApplicationNameConverter.class);
72+
config.conversionRule("applicationGroup", ApplicationGroupConverter.class);
7273
config.conversionRule("clr", ColorConverter.class);
7374
config.conversionRule("correlationId", CorrelationIdConverter.class);
7475
config.conversionRule("wex", WhitespaceThrowableProxyConverter.class);
7576
config.conversionRule("wEx", ExtendedWhitespaceThrowableProxyConverter.class);
7677
config.getContext()
7778
.putProperty("CONSOLE_LOG_PATTERN", resolve(config, "${CONSOLE_LOG_PATTERN:-"
7879
+ "%clr(%d{${LOG_DATEFORMAT_PATTERN:-yyyy-MM-dd'T'HH:mm:ss.SSSXXX}}){faint} %clr(${LOG_LEVEL_PATTERN:-%5p}) "
79-
+ "%clr(${PID:- }){magenta} %clr(---){faint} %clr(%applicationName[%15.15t]){faint} "
80+
+ "%clr(${PID:- }){magenta} %clr(---){faint} %clr(%applicationName[%15.15t]){faint} %clr(---){faint} %clr(%applicationGroup[%15.15t]){faint} "
8081
+ "%clr(${LOG_CORRELATION_PATTERN:-}){faint}%clr(%-40.40logger{39}){cyan} "
8182
+ "%clr(:){faint} %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}}"));
8283
String defaultCharset = Charset.defaultCharset().name();
@@ -85,7 +86,7 @@ private void defaults(LogbackConfigurator config) {
8586
config.getContext().putProperty("CONSOLE_LOG_THRESHOLD", resolve(config, "${CONSOLE_LOG_THRESHOLD:-TRACE}"));
8687
config.getContext()
8788
.putProperty("FILE_LOG_PATTERN", resolve(config, "${FILE_LOG_PATTERN:-"
88-
+ "%d{${LOG_DATEFORMAT_PATTERN:-yyyy-MM-dd'T'HH:mm:ss.SSSXXX}} ${LOG_LEVEL_PATTERN:-%5p} ${PID:- } --- %applicationName[%t] "
89+
+ "%d{${LOG_DATEFORMAT_PATTERN:-yyyy-MM-dd'T'HH:mm:ss.SSSXXX}} ${LOG_LEVEL_PATTERN:-%5p} ${PID:- } --- %applicationName[%t] --- %applicationGroup[%t] "
8990
+ "${LOG_CORRELATION_PATTERN:-}"
9091
+ "%-40.40logger{39} : %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}}"));
9192
config.getContext()

spring-boot-project/spring-boot/src/main/java/org/springframework/boot/logging/logback/LogbackRuntimeHints.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,9 +58,9 @@ private void registerHintsForBuiltInLogbackConverters(ReflectionHints reflection
5858
}
5959

6060
private void registerHintsForSpringBootConverters(ReflectionHints reflection) {
61-
registerForPublicConstructorInvocation(reflection, ApplicationNameConverter.class, ColorConverter.class,
62-
ExtendedWhitespaceThrowableProxyConverter.class, WhitespaceThrowableProxyConverter.class,
63-
CorrelationIdConverter.class);
61+
registerForPublicConstructorInvocation(reflection, ApplicationNameConverter.class,
62+
ApplicationGroupConverter.class, ColorConverter.class, ExtendedWhitespaceThrowableProxyConverter.class,
63+
WhitespaceThrowableProxyConverter.class, CorrelationIdConverter.class);
6464
}
6565

6666
private void registerForPublicConstructorInvocation(ReflectionHints reflection, Class<?>... classes) {

spring-boot-project/spring-boot/src/main/resources/org/springframework/boot/logging/log4j2/log4j2-file.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
<Property name="LOG_EXCEPTION_CONVERSION_WORD">%xwEx</Property>
55
<Property name="LOG_LEVEL_PATTERN">%5p</Property>
66
<Property name="LOG_DATEFORMAT_PATTERN">yyyy-MM-dd'T'HH:mm:ss.SSSXXX</Property>
7-
<Property name="CONSOLE_LOG_PATTERN">%clr{%d{${sys:LOG_DATEFORMAT_PATTERN}}}{faint} %clr{${sys:LOG_LEVEL_PATTERN}} %clr{%pid}{magenta} %clr{---}{faint} %clr{${sys:LOGGED_APPLICATION_NAME:-}[%15.15t]}{faint} %clr{${sys:LOG_CORRELATION_PATTERN:-}}{faint}%clr{%-40.40c{1.}}{cyan} %clr{:}{faint} %m%n${sys:LOG_EXCEPTION_CONVERSION_WORD}</Property>
8-
<Property name="FILE_LOG_PATTERN">%d{${sys:LOG_DATEFORMAT_PATTERN}} ${sys:LOG_LEVEL_PATTERN} %pid --- ${sys:LOGGED_APPLICATION_NAME:-}[%t] ${sys:LOG_CORRELATION_PATTERN:-}%-40.40c{1.} : %m%n${sys:LOG_EXCEPTION_CONVERSION_WORD}</Property>
7+
<Property name="CONSOLE_LOG_PATTERN">%clr{%d{${sys:LOG_DATEFORMAT_PATTERN}}}{faint} %clr{${sys:LOG_LEVEL_PATTERN}} %clr{%pid}{magenta} %clr{---}{faint} %clr{${sys:LOGGED_APPLICATION_NAME:-}[%15.15t]}{faint} %clr{---}{faint} %clr{${sys:LOGGED_APPLICATION_GROUP:-}[%15.15t]}{faint} %clr{${sys:LOG_CORRELATION_PATTERN:-}}{faint}%clr{%-40.40c{1.}}{cyan} %clr{:}{faint} %m%n${sys:LOG_EXCEPTION_CONVERSION_WORD}</Property>
8+
<Property name="FILE_LOG_PATTERN">%d{${sys:LOG_DATEFORMAT_PATTERN}} ${sys:LOG_LEVEL_PATTERN} %pid --- ${sys:LOGGED_APPLICATION_NAME:-} --- ${sys:LOGGED_APPLICATION_GROUP:-}[%t] ${sys:LOG_CORRELATION_PATTERN:-}%-40.40c{1.} : %m%n${sys:LOG_EXCEPTION_CONVERSION_WORD}</Property>
99
</Properties>
1010
<Appenders>
1111
<Console name="Console" target="SYSTEM_OUT" follow="true">

spring-boot-project/spring-boot/src/main/resources/org/springframework/boot/logging/log4j2/log4j2.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
<Property name="LOG_EXCEPTION_CONVERSION_WORD">%xwEx</Property>
55
<Property name="LOG_LEVEL_PATTERN">%5p</Property>
66
<Property name="LOG_DATEFORMAT_PATTERN">yyyy-MM-dd'T'HH:mm:ss.SSSXXX</Property>
7-
<Property name="CONSOLE_LOG_PATTERN">%clr{%d{${sys:LOG_DATEFORMAT_PATTERN}}}{faint} %clr{${sys:LOG_LEVEL_PATTERN}} %clr{%pid}{magenta} %clr{---}{faint} %clr{${sys:LOGGED_APPLICATION_NAME:-}[%15.15t]}{faint} %clr{${sys:LOG_CORRELATION_PATTERN:-}}{faint}%clr{%-40.40c{1.}}{cyan} %clr{:}{faint} %m%n${sys:LOG_EXCEPTION_CONVERSION_WORD}</Property>
8-
<Property name="FILE_LOG_PATTERN">%d{${sys:LOG_DATEFORMAT_PATTERN}} ${sys:LOG_LEVEL_PATTERN} %pid --- ${sys:LOGGED_APPLICATION_NAME:-}[%t] ${sys:LOG_CORRELATION_PATTERN:-}%-40.40c{1.} : %m%n${sys:LOG_EXCEPTION_CONVERSION_WORD}</Property>
7+
<Property name="CONSOLE_LOG_PATTERN">%clr{%d{${sys:LOG_DATEFORMAT_PATTERN}}}{faint} %clr{${sys:LOG_LEVEL_PATTERN}} %clr{%pid}{magenta} %clr{---}{faint} %clr{${sys:LOGGED_APPLICATION_NAME:-}[%15.15t]} {faint}%clr{---}{faint} %clr{${sys:LOGGED_APPLICATION_GROUP:-}[%15.15t]}{faint} %clr{${sys:LOG_CORRELATION_PATTERN:-}}{faint}%clr{%-40.40c{1.}}{cyan} %clr{:}{faint} %m%n${sys:LOG_EXCEPTION_CONVERSION_WORD}</Property>
8+
<Property name="FILE_LOG_PATTERN">%d{${sys:LOG_DATEFORMAT_PATTERN}} ${sys:LOG_LEVEL_PATTERN} %pid --- ${sys:LOGGED_APPLICATION_NAME:-} --- ${sys:LOGGED_APPLICATION_GROUP:-}[%t] ${sys:LOG_CORRELATION_PATTERN:-}%-40.40c{1.} : %m%n${sys:LOG_EXCEPTION_CONVERSION_WORD}</Property>
99
</Properties>
1010
<Appenders>
1111
<Console name="Console" target="SYSTEM_OUT" follow="true">

spring-boot-project/spring-boot/src/main/resources/org/springframework/boot/logging/logback/defaults.xml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,16 @@ Default logback configuration provided for import
66

77
<included>
88
<conversionRule conversionWord="applicationName" converterClass="org.springframework.boot.logging.logback.ApplicationNameConverter" />
9+
<conversionRule conversionWord="applicationGroup" converterClass="org.springframework.boot.logging.logback.ApplicationGroupConverter" />
910
<conversionRule conversionWord="clr" converterClass="org.springframework.boot.logging.logback.ColorConverter" />
1011
<conversionRule conversionWord="correlationId" converterClass="org.springframework.boot.logging.logback.CorrelationIdConverter" />
1112
<conversionRule conversionWord="wex" converterClass="org.springframework.boot.logging.logback.WhitespaceThrowableProxyConverter" />
1213
<conversionRule conversionWord="wEx" converterClass="org.springframework.boot.logging.logback.ExtendedWhitespaceThrowableProxyConverter" />
1314

14-
<property name="CONSOLE_LOG_PATTERN" value="${CONSOLE_LOG_PATTERN:-%clr(%d{${LOG_DATEFORMAT_PATTERN:-yyyy-MM-dd'T'HH:mm:ss.SSSXXX}}){faint} %clr(${LOG_LEVEL_PATTERN:-%5p}) %clr(${PID:- }){magenta} %clr(---){faint} %clr(%applicationName[%15.15t]){faint} %clr(${LOG_CORRELATION_PATTERN:-}){faint}%clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}}"/>
15+
<property name="CONSOLE_LOG_PATTERN" value="${CONSOLE_LOG_PATTERN:-%clr(%d{${LOG_DATEFORMAT_PATTERN:-yyyy-MM-dd'T'HH:mm:ss.SSSXXX}}){faint} %clr(${LOG_LEVEL_PATTERN:-%5p}) %clr(${PID:- }){magenta} %clr(---){faint} %clr(%applicationName[%15.15t]){faint} %clr(---){faint} %clr(%applicationGroup[%15.15t]){faint} %clr(${LOG_CORRELATION_PATTERN:-}){faint}%clr(%-40.40logger{39}){cyan} %clr(:){faint} %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}}"/>
1516
<property name="CONSOLE_LOG_CHARSET" value="${CONSOLE_LOG_CHARSET:-${file.encoding:-UTF-8}}"/>
1617
<property name="CONSOLE_LOG_THRESHOLD" value="${CONSOLE_LOG_THRESHOLD:-TRACE}"/>
17-
<property name="FILE_LOG_PATTERN" value="${FILE_LOG_PATTERN:-%d{${LOG_DATEFORMAT_PATTERN:-yyyy-MM-dd'T'HH:mm:ss.SSSXXX}} ${LOG_LEVEL_PATTERN:-%5p} ${PID:- } --- %applicationName[%t] ${LOG_CORRELATION_PATTERN:-}%-40.40logger{39} : %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}}"/>
18+
<property name="FILE_LOG_PATTERN" value="${FILE_LOG_PATTERN:-%d{${LOG_DATEFORMAT_PATTERN:-yyyy-MM-dd'T'HH:mm:ss.SSSXXX}} ${LOG_LEVEL_PATTERN:-%5p} ${PID:- } --- %applicationName[%t] --- %applicationGroup[%t] ${LOG_CORRELATION_PATTERN:-}%-40.40logger{39} : %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}}"/>
1819
<property name="FILE_LOG_CHARSET" value="${FILE_LOG_CHARSET:-${file.encoding:-UTF-8}}"/>
1920
<property name="FILE_LOG_THRESHOLD" value="${FILE_LOG_THRESHOLD:-TRACE}"/>
2021

0 commit comments

Comments
 (0)