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

Preserve attribute type for logback key value pairs #10781

Merged
merged 3 commits into from
Mar 12, 2024

Conversation

laurit
Copy link
Contributor

@laurit laurit commented Mar 8, 2024

Resolves #10776
Preserve attribute type for attributes created for logback key value pairs. Type is preserved only for primitives and their wrapper types, arrays and lists are not handled.

@laurit laurit requested a review from a team March 8, 2024 11:28
if (keyValuePair.value != null) {
attributes.put(getAttributeKey(keyValuePair.key), keyValuePair.value.toString());
if (value instanceof Boolean) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Might it be more friendly for code reading by adding some comments explaining what types are processed now?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not sure what comment you are asking for.

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure what comment you are asking for.

I mean we can add some comment to describe what types are supported and what types are not supported to preserve attribute type now.

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.

👍 this makes sense to me from the perspective of log bridging

cc @jack-berg

@trask trask added this to the v2.2.0 milestone Mar 11, 2024
@laurit laurit merged commit 2df9001 into open-telemetry:main Mar 12, 2024
49 checks passed
@laurit laurit deleted the logback-preserve-type branch March 12, 2024 07:25
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.

logback-appender-1.0's captureKeyValuePairAttributes implementation lost value type
4 participants