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

Feature request: Support StructuredArgument #64

Open
knittl opened this issue Dec 23, 2019 · 3 comments
Open

Feature request: Support StructuredArgument #64

knittl opened this issue Dec 23, 2019 · 3 comments

Comments

@knittl
Copy link

knittl commented Dec 23, 2019

Support something similar to what logstash-logback-encoder offers, namely "Structured arguments", which allow easy adding of fields to your documents sent to Elasticsearch.

This is already possible when putting fields into the MDC with the correct encoder, but populating and then clearing the MDC is cumbersome.

Sample usage:

LOG.debug("Rendering took {} ms for {}", StructuredArguments.value("duration.ms", durationMs), StructuredArguments.keyValue("username", "userid"));

(Might be related to #31)

@ntvf
Copy link

ntvf commented Feb 9, 2020

Pull request for this one #65

@knittl
Copy link
Author

knittl commented Feb 9, 2020

I started porting over the code from https://github.com/logstash/logstash-logback-encoder in https://github.com/knittl/logback-elasticsearch-appender/tree/feature/structured-arguments but I am still unsure whether or not this is OK from a license compatibility standpoint.

@philsttr can you say something regarding this topic?

@philsttr
Copy link

philsttr commented Feb 10, 2020

I'm definitely not a lawyer, but I assume you just need to follow the conditions in Section 4. Redistribution of Apache License 2.0 (which is the license used by logstash-logback-encoder)

Alternatively, you could make logback-elasticsearch-appender depend on logstash-logback-encoder to take advantage of all of its JsonProviders and Structured Arguments without having to copy/paste.

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

No branches or pull requests

3 participants