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

Adding extension point allowing subclasses to add more data to the json log #41

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

posto
Copy link

@posto posto commented May 7, 2014

Hi,

I'm working on a custom JSON Logstash Appender that would add some company-specific fields to the logged events. It would really help if JSONEventLayoutV1 would provide an extension point.

Please let me know what you think.

Thanks,
Dumitru

@posto
Copy link
Author

posto commented Sep 4, 2014

Any chance to get this into the master? This issue is blocking our upgrade to latest logstash format :(

@lusis
Copy link
Contributor

lusis commented Sep 9, 2014

@posto oh sorry I just saw this. Taking a look now.

@lusis
Copy link
Contributor

lusis commented Sep 9, 2014

@posto is there any reason you wouldn't use MDC or NDC in this case? That's really what it was designed for. Maybe I'm missing something?

@posto
Copy link
Author

posto commented Sep 12, 2014

@lusis -- MDC/NCD works for thread-bound data, for example for logging the user id making the request. These values would be set from the application code, because this is where it is available and it changes for each request.

In my case, I have a constant -- the application version, which never changes while the application is running. It's very similar to the @ version field that you already have. I find it quite hard to try to inject this constant as a MDC in every thread that runs in the app. It is much easier to extend your Layout, so that when the application starts -- it detects it's versions and always logs this.

My point is: MDC is for data that changes and what I want is to customize the logging output with yet another constant, similar to the @ version field.

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

Successfully merging this pull request may close these issues.

2 participants