Skip to content

Commit 192efca

Browse files
committed
Move ConditionalOnEnabledLoggingExport to opentelemetry module
This commit moves the `ConditionalOnEnabledLoggingExport` condition from the "spring-boot-actuator-autoconfigure" to the "spring-boot-opentelemetry" one, because without that the logging export feature requires the actuator module to be on the classpath. Fixes gh-48488
1 parent 72afdfd commit 192efca

File tree

7 files changed

+6
-9
lines changed

7 files changed

+6
-9
lines changed

module/spring-boot-opentelemetry/build.gradle

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ dependencies {
3333
optional(project(":core:spring-boot-autoconfigure"))
3434
optional(project(":core:spring-boot-docker-compose"))
3535
optional(project(":core:spring-boot-testcontainers"))
36-
optional(project(":module:spring-boot-actuator-autoconfigure"))
3736
optional("io.opentelemetry:opentelemetry-exporter-otlp")
3837
optional("org.testcontainers:testcontainers-grafana")
3938

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
package org.springframework.boot.actuate.autoconfigure.logging;
17+
package org.springframework.boot.opentelemetry.autoconfigure.logging;
1818

1919
import java.lang.annotation.Documented;
2020
import java.lang.annotation.ElementType;

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
package org.springframework.boot.actuate.autoconfigure.logging;
17+
package org.springframework.boot.opentelemetry.autoconfigure.logging;
1818

1919
import java.util.Map;
2020

module/spring-boot-opentelemetry/src/main/java/org/springframework/boot/opentelemetry/autoconfigure/logging/otlp/OtlpLoggingAutoConfiguration.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
import io.opentelemetry.api.OpenTelemetry;
2020
import io.opentelemetry.sdk.logs.SdkLoggerProvider;
2121

22-
import org.springframework.boot.actuate.autoconfigure.logging.ConditionalOnEnabledLoggingExport;
2322
import org.springframework.boot.autoconfigure.AutoConfiguration;
2423
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
2524
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
@@ -35,7 +34,7 @@
3534
* @since 4.0.0
3635
*/
3736
@AutoConfiguration
38-
@ConditionalOnClass({ ConditionalOnEnabledLoggingExport.class, OpenTelemetry.class, SdkLoggerProvider.class })
37+
@ConditionalOnClass({ OpenTelemetry.class, SdkLoggerProvider.class })
3938
@EnableConfigurationProperties(OtlpLoggingProperties.class)
4039
@Import({ ConnectionDetails.class, Exporters.class })
4140
public final class OtlpLoggingAutoConfiguration {

module/spring-boot-opentelemetry/src/main/java/org/springframework/boot/opentelemetry/autoconfigure/logging/otlp/OtlpLoggingConfigurations.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@
2525
import io.opentelemetry.exporter.otlp.logs.OtlpGrpcLogRecordExporterBuilder;
2626

2727
import org.springframework.beans.factory.ObjectProvider;
28-
import org.springframework.boot.actuate.autoconfigure.logging.ConditionalOnEnabledLoggingExport;
2928
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
3029
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
3130
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
3231
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
32+
import org.springframework.boot.opentelemetry.autoconfigure.logging.ConditionalOnEnabledLoggingExport;
3333
import org.springframework.context.annotation.Bean;
3434
import org.springframework.context.annotation.Configuration;
3535
import org.springframework.util.Assert;

module/spring-boot-opentelemetry/src/main/java/org/springframework/boot/opentelemetry/autoconfigure/logging/otlp/OtlpLoggingConnectionDetails.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@
1919
import org.springframework.boot.autoconfigure.service.connection.ConnectionDetails;
2020

2121
/**
22-
* Details required for actuator to establish a connection to an OpenTelemetry logging
23-
* service.
22+
* Details required to establish a connection to an OpenTelemetry logging service.
2423
*
2524
* @author Toshiaki Maki
2625
* @since 4.0.0

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
* limitations under the License.
1515
*/
1616

17-
package org.springframework.boot.actuate.autoconfigure.logging;
17+
package org.springframework.boot.opentelemetry.autoconfigure.logging;
1818

1919
import java.util.Collections;
2020
import java.util.Map;

0 commit comments

Comments
 (0)