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

Add logstash support for Console transport #472

Closed
wants to merge 10 commits into from

Conversation

ramonsnir
Copy link
Contributor

We, for example, use supervisor to take the stdout of all our processes and merge them into a huge logstash-log blob.

@indexzero
Copy link
Member

@ramonsnir can you investigate why the build failed?

@ramonsnir
Copy link
Contributor Author

@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).

@jcrugzz
Copy link
Contributor

jcrugzz commented Nov 4, 2014

LGTM.

return JSON.stringify(obj, null, 2);
};
this.stringify = options.stringify;
if (!this.logstash) {
Copy link
Member

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?

Copy link
Contributor Author

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.

indexzero added a commit that referenced this pull request Nov 7, 2014
@indexzero
Copy link
Member

@ramonsnir I cherry-picked one commit from this. It is unecessary to set both the logstash and json options if you are on the latest winston. There were a number of fixes for this in winston@0.8.0

@indexzero indexzero closed this Nov 7, 2014
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.

3 participants