Skip to content
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

Add option to capture logback key value pairs #8074

Merged
merged 4 commits into from
Apr 3, 2023

Conversation

laurit
Copy link
Contributor

@laurit laurit commented Mar 17, 2023

Resolves #8059

@laurit laurit requested a review from a team as a code owner March 17, 2023 10:04
import org.slf4j.LoggerFactory;
import org.slf4j.MarkerFactory;

public class Slf4j2Test {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not blocking: Would be interesting to see what happens with Slf4j using log4j as the backend. I think key value pairs show up in log4j context data. When adding log4j context data, we prefix all the keys with log4j.context.. So effectively, if you use SLF4j, the mapping experience differs based on whether you use log4j or logback as the backend.

We should strive to make the two experiences consistent.

Maybe we need a dedicated slf4j testing module where we apply the same abstract test to the logback and log4j implementations and verify the expected behavior?

Copy link
Member

@trask trask left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not blocking: Would be interesting to see what happens with Slf4j using log4j as the backend. I think key value pairs show up in log4j context data. When adding log4j context data, we prefix all the keys with log4j.context.. So effectively, if you use SLF4j, the mapping experience differs based on whether you use log4j or logback as the backend.

We should strive to make the two experiences consistent.

it doesn't bother me too much at this point, since the instrumentation is at the logback/log4j layer (as opposed to at the slf4j layer), and we don't have any logging semantic conventions yet to unify the two experiences.

Maybe we need a dedicated slf4j testing module where we apply the same abstract test to the logback and log4j implementations and verify the expected behavior?

👍 once we have logging semantic conventions to unify them

@trask trask merged commit 1393604 into open-telemetry:main Apr 3, 2023
@laurit laurit deleted the logback-key-value-pair branch July 6, 2023 17:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Capture Logback KeyValuePairs
4 participants