Skip to content

Remove the log4j.map_message prefix from attributes from that logging instrumentation #13787

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

Open
harsimar opened this issue Apr 28, 2025 · 2 comments · May be fixed by #13871
Open

Remove the log4j.map_message prefix from attributes from that logging instrumentation #13787

harsimar opened this issue Apr 28, 2025 · 2 comments · May be fixed by #13871
Assignees
Labels
contribution welcome Request makes sense, maintainers probably won't have time, contribution would be welcome enhancement New feature or request
Milestone

Comments

@harsimar
Copy link

Is your feature request related to a problem? Please describe.

I was wondering if there is a specific reason why the log4j.map_message prefix is appended onto attributes produced by that instrumentation, and if it is possible to remove it, similar to how it has been done for MDC: #9536.

In the application insights java agent, we recently implemented a feature where a specific log attribute is parsed to send a different kind of telemetry to application insights. This feature does not currently work for logs produced by mapMessage() as the attribute name with the prefix appended on to it does not match a specific attribute name we are looking for.
cc: @trask

Describe the solution you'd like

Logs that are produced from the log4j mapMessage() method should not append a prefix on any custom attributes. Ideally the current prefix should be removed.

Describe alternatives you've considered

In application insights java agent code, we can add an extra condition to search for "log4j.map_message" + specialAttributeName. However, there may be slightly better performance if we didn't need to add an extra condition to begin with.

Additional context

No response

@harsimar harsimar added enhancement New feature or request needs triage New issue that requires triage labels Apr 28, 2025
@trask trask added contribution welcome Request makes sense, maintainers probably won't have time, contribution would be welcome and removed needs triage New issue that requires triage labels May 1, 2025
@trask trask added this to the v3.0.0 milestone May 1, 2025
@trask
Copy link
Member

trask commented May 1, 2025

We'd welcome a contribution for this, we may hold on merging the PR until 3.0 to avoid user churn.

@AlchemyDing
Copy link
Member

@trask I am willing to contribute to this, please assign this issue to me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contribution welcome Request makes sense, maintainers probably won't have time, contribution would be welcome enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants