-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Add logstash support for Console transport #472
Conversation
@ramonsnir can you investigate why the build failed? |
…-doc Updating winston-graylog2 transport documentation
@indexzero The error wasn't reproducible locally. I synced my branch to make sure, but also to force a re-build in Travis. Seems that Travis agrees with me that it was just a glitch (note: the only failure was with some of the DailyRotateLog tests, which aren't related to my change). |
LGTM. |
return JSON.stringify(obj, null, 2); | ||
}; | ||
this.stringify = options.stringify; | ||
if (!this.logstash) { |
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.
Why exactly is this necessary? Why not just pass down the logstash
option?
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.
Logstash (at least in our version) expects each log event to be in a single line, and the (obj, null, **2**)
forces the output to be pretty-printed (and broken into several lines). I don't know if this is the most ideal solution, but it worked.
@ramonsnir I cherry-picked one commit from this. It is unecessary to set both the |
We, for example, use supervisor to take the stdout of all our processes and merge them into a huge logstash-log blob.