Skip to content

Restore the public access level of the Log4jMarker class to its pre-2.19.0 state #1414

Closed
@AlexxeyKa

Description

@AlexxeyKa

Hello,

I would like to request that the org.apache.logging.slf4j.Log4jMarker class be made public once again, as it was prior to version 2.19.0.

Having markers in the LogEvent is a powerful mechanism for passing custom markers with custom fields inside. Previously, it was possible to implement a custom marker and pass it through the log4j logger as a Log4jMarker, which could then be caught in a custom FieldProvider, analyzed, and acted upon.

However, with the release of version 2.19.0, this functionality was removed by making the Log4jMarker class package-private. As a result, all custom markers are converted into Log4jMarker inside the Log4jMarkerFactory, and only the name and parents fields are retained, which is unacceptable for our use case.

Therefore, I request that the Log4jMarker class be made public once again, in order to allow for the same level of flexibility and customization that was available prior to version 2.19.0. Additionally, I would like to note that the Log4jMarker constructor remains public, so making the class itself public should not pose any security concerns.

Thank you for your consideration.

Metadata

Metadata

Assignees

Labels

apiAffects the public APIbugIncorrect, unexpected, or unintended behavior of existing code

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions