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

Retrieve PID of the running process and add it to MDC #59

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

Conversation

eht16
Copy link

@eht16 eht16 commented Feb 7, 2016

This will retrieve the PID of the currently running process (this is done only once as the PID will never change during runtime) and then add it to the MDC if it is not already present.

The resulting Logstash events will have a mdc.pid field containing the process ID.
Tested on Windows and Linux with OpenJDK 7 and 8.

This will retrieve the PID of the currently running process (this is done only once as the PID will never change during runtime) and then add it to the MDC if it is not already present.

The resulting Logstash events will have a `mdc.pid` field containing the process ID.
Tested on Windows and Linux with OpenJDK 7 and 8.
@eht16
Copy link
Author

eht16 commented Feb 7, 2016

Side note: I'm not a Java programmer. Maybe this can be done more easily and/or more portable. But it seems to work for me.

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.

1 participant