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

LogstashAccessEncoder#fieldNames does not change the field name used by ContextJsonProvider #658

Closed
brenuart opened this issue Sep 23, 2021 · 0 comments · Fixed by #659
Closed
Labels
Milestone

Comments

@brenuart
Copy link
Collaborator

Changing default field names on LogstashAccessEncoder by setting the fieldNames property does not change the name of the field used by the ContextJsonProvider.

The cause is the "instanceof" at line https://github.com/logstash/logstash-logback-encoder/blob/main/src/main/java/net/logstash/logback/composite/ContextJsonProvider.java#L57.

The "context" field is applicable to both IAccessEvent and ILoggingEvent and should therefore be declared in CommonLogstashFieldNames instead of LogstashFieldNames.

brenuart added a commit that referenced this issue Sep 23, 2021
ContextJsonProvider can be used for both ILoggingEvent and IAccessEvent. The `LoggingEventJsonProviders#addContext` and `AccessEventJsonProviders#addContext` methods should be moved into the common `JsonProviders` base class.

Related to issue #658.
@philsttr philsttr added this to the 7.0 milestone Nov 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants