Skip to content

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

@harsimar

Description

@harsimar

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

Metadata

Metadata

Assignees

Labels

contribution welcomeRequest makes sense, maintainers probably won't have time, contribution would be welcomeenhancementNew feature or request

Type

No type

Projects

Status

No status

Relationships

None yet

Development

No branches or pull requests

Issue actions