-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Allow Logstash to write its logs in JSON format #5277
Conversation
This is made available by a --log-in-json flag. Default is false. When false, the old behavior [1] is used. When true, JSON logs are emitted. [1] The old behavior is realy two things. First, using Object#inspect to serialize. Second, to color the output if the IO is a tty. For #1569 This is a manual backport of PR #4820 into the 2.x branch.
With a clean checkout of the repository. After doing:
When I start logstash with this line it crash. :(
|
Hmm, kind of annoying that the tests don't catch something this simple. I'll see what I can do. |
@ph fixed. |
@@ -480,7 +480,7 @@ def start_pipeline(id) | |||
begin | |||
pipeline.run | |||
rescue => e | |||
@logger.error("Pipeline aborted due to error", :exception => e, :backtrace => e.backtrace) | |||
@logger.error("Pipeline aborted due to error", :exception => e.class.name, :backtrace => e.backtrace) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is somewhat common to use this kind of line in the plugins, I've seen it a lot and I have use it myself.
It fixed the issue for me, @jordansissel 2.4/5.0 beta absolutely need to go out with the new version of jrjackson, guyboertje/jrjackson#54 |
The code LGTM. |
@ph +1 on shipping 2.4/5.0beta1 with a newer jrjackson |
@jordansissel I have created this #5278 to make sure we dont drop the ball. I am +1 to merge your changes. |
This is made available by a --log-in-json flag. Default is false. When false, the old behavior [1] is used. When true, JSON logs are emitted. [1] The old behavior is realy two things. First, using Object#inspect to serialize. Second, to color the output if the IO is a tty. For #1569 This is a manual backport of PR #4820 into the 2.x branch. Fixes #5277
Allow Logstash to write its logs in JSON format
This is made available by a --log-in-json flag. Default is false.
When false, the old behavior [1] is used.
When true, JSON logs are emitted.
[1] The old behavior is really two things. First, using Object#inspect to
serialize. Second, to color the output if the IO is a tty.
For #1569
This is a manual backport of PR #4820 into the 2.x branch.