-
Notifications
You must be signed in to change notification settings - Fork 925
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow the Spring starter to configure the OTel Logback appender from system properties #10355
Allow the Spring starter to configure the OTel Logback appender from system properties #10355
Conversation
…system properties
If an attribute is configured both in the Logback XML file and with a system property, the system property overrides the configuration. |
...entation/spring/spring-boot-autoconfigure/src/testLogbackAppender/resources/logback-test.xml
Show resolved
Hide resolved
...emetry/instrumentation/spring/autoconfigure/instrumentation/logging/LogbackAppenderTest.java
Show resolved
Hide resolved
...ntation/spring/autoconfigure/instrumentation/logging/LogbackAppenderApplicationListener.java
Show resolved
Hide resolved
...-tests-otel-starter/src/test/java/io/opentelemetry/smoketest/OtelSpringStarterSmokeTest.java
Outdated
Show resolved
Hide resolved
@@ -0,0 +1,44 @@ | |||
{ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
will this file conflict with the one we're autogenerating?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No. See https://docs.spring.io/spring-boot/docs/current/reference/html/configuration-metadata.html#appendix.configuration-metadata.annotation-processor.adding-additional-metadata: "the annotation processor automatically merges items from META-INF/additional-spring-configuration-metadata.json into the main metadata file."
With #10306, the OTel Logback appender is added by the OTel starter if the appender is not declared in a Logback XML file.
With this PR it becomes possible the configure the OpenTelemetry Logback appender with system properties from the Spring starter, as the OpenTelemetry Java agent is able to do.