Skip to content

Commit 93381c7

Browse files
committed
Switch property backing OnEnabledLoggingExportCondition
It's now 'management.logging.export.{name}.enabled'. Closes gh-47957
1 parent 8920434 commit 93381c7

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

module/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/logging/ConditionalOnEnabledLoggingExport.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
* {@link Conditional @Conditional} that checks whether logging export is enabled. It
2929
* matches if the value of the {@code management.logging.export.enabled} property is
3030
* {@code true} or if it is not configured. If the {@link #value() logging exporter name}
31-
* is set, the {@code management.<name>.logging.export.enabled} property can be used to
31+
* is set, the {@code management.logging.export.<name>.enabled} property can be used to
3232
* control the behavior for the specific logging exporter. In that case, the
3333
* exporter-specific property takes precedence over the global property.
3434
*

module/spring-boot-actuator-autoconfigure/src/main/java/org/springframework/boot/actuate/autoconfigure/logging/OnEnabledLoggingExportCondition.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class OnEnabledLoggingExportCondition extends SpringBootCondition {
3838

3939
private static final String GLOBAL_PROPERTY = "management.logging.export.enabled";
4040

41-
private static final String EXPORTER_PROPERTY = "management.%s.logging.export.enabled";
41+
private static final String EXPORTER_PROPERTY = "management.logging.export.%s.enabled";
4242

4343
@Override
4444
public ConditionOutcome getMatchOutcome(ConditionContext context, AnnotatedTypeMetadata metadata) {

module/spring-boot-actuator-autoconfigure/src/test/java/org/springframework/boot/actuate/autoconfigure/logging/OnEnabledLoggingExportConditionTests.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class OnEnabledLoggingExportConditionTests {
4040

4141
private static final String GLOBAL_PROPERTY_NAME = "management.logging.export.enabled";
4242

43-
private static final String OTLP_PROPERTY_NAME = "management.otlp.logging.export.enabled";
43+
private static final String OTLP_PROPERTY_NAME = "management.logging.export.otlp.enabled";
4444

4545
@Test
4646
void shouldMatchIfNoPropertyIsSet() {
@@ -77,7 +77,7 @@ void shouldNotMatchIfExporterPropertyIsFalse() {
7777
mockMetadata("otlp"));
7878
assertThat(outcome.isMatch()).isFalse();
7979
assertThat(outcome.getMessage())
80-
.isEqualTo("@ConditionalOnEnabledLoggingExport management.otlp.logging.export.enabled is false");
80+
.isEqualTo("@ConditionalOnEnabledLoggingExport management.logging.export.otlp.enabled is false");
8181
}
8282

8383
@Test
@@ -87,7 +87,7 @@ void shouldMatchIfExporterPropertyIsTrue() {
8787
mockMetadata("otlp"));
8888
assertThat(outcome.isMatch()).isTrue();
8989
assertThat(outcome.getMessage())
90-
.isEqualTo("@ConditionalOnEnabledLoggingExport management.otlp.logging.export.enabled is true");
90+
.isEqualTo("@ConditionalOnEnabledLoggingExport management.logging.export.otlp.enabled is true");
9191
}
9292

9393
@Test
@@ -98,7 +98,7 @@ void exporterPropertyShouldOverrideGlobalPropertyIfTrue() {
9898
mockMetadata("otlp"));
9999
assertThat(outcome.isMatch()).isTrue();
100100
assertThat(outcome.getMessage())
101-
.isEqualTo("@ConditionalOnEnabledLoggingExport management.otlp.logging.export.enabled is true");
101+
.isEqualTo("@ConditionalOnEnabledLoggingExport management.logging.export.otlp.enabled is true");
102102
}
103103

104104
@Test
@@ -109,7 +109,7 @@ void exporterPropertyShouldOverrideGlobalPropertyIfFalse() {
109109
mockMetadata("otlp"));
110110
assertThat(outcome.isMatch()).isFalse();
111111
assertThat(outcome.getMessage())
112-
.isEqualTo("@ConditionalOnEnabledLoggingExport management.otlp.logging.export.enabled is false");
112+
.isEqualTo("@ConditionalOnEnabledLoggingExport management.logging.export.otlp.enabled is false");
113113
}
114114

115115
private ConditionContext mockConditionContext() {

0 commit comments

Comments
 (0)