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

Updates winston-graylog2 to use [email protected] #67

Merged
merged 30 commits into from
Jan 28, 2019
Merged

Updates winston-graylog2 to use [email protected] #67

merged 30 commits into from
Jan 28, 2019

Conversation

jeremy-j-ackso
Copy link
Contributor

Resolves #65 when using Winston 3.

Implements the transport as an ES6 class, which is more compatible with where both Node and Winston are going.

Does have breaking changes, such as removing prelog and processMeta, since these situations will be better handled by Winston 3 custom formatters.

@odino
Copy link
Contributor

odino commented Dec 29, 2018

@schfkt would you mind having a look here?

@schfkt
Copy link
Collaborator

schfkt commented Dec 30, 2018

@odino sure

@jeremy-j-ackso
Copy link
Contributor Author

@schfkt @odino Just checking in, what feedback do you have or modifications you need to see from me to help get this merged?

@odino odino requested a review from schfkt January 3, 2019 14:17
@schfkt
Copy link
Collaborator

schfkt commented Jan 3, 2019

@jeremy-j-ackso sorry, I didn't have much time to check it yet due to the holidays :) I'll try to review this later today or tomorrow.

Copy link
Collaborator

@schfkt schfkt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jeremy-j-ackso Looks good overall! But did you try that transport yourself? Since the repo doesn't have any e2e tests now, I have no idea if this works or no.

lib/winston-graylog2.js Outdated Show resolved Hide resolved
lib/winston-graylog2.js Outdated Show resolved Hide resolved
lib/winston-graylog2.js Outdated Show resolved Hide resolved
lib/winston-graylog2.js Show resolved Hide resolved
lib/winston-graylog2.js Outdated Show resolved Hide resolved
readme.md Outdated Show resolved Hide resolved
@jeremy-j-ackso
Copy link
Contributor Author

@schfkt Here's a sample repo where I use it: https://github.com/jeremy-j-ackso/wgl-example.

I'm not 100% sure there were e2e tests to begin with, but could be wrong.

@jeremy-j-ackso
Copy link
Contributor Author

@schfkt I've updated my sample repo to include usage of a formatter to deal with errors similarly to how processMeta() used to and to also log out an error.

Also, while poking around I discovered that there's a pretty strong issue in Winston for taking care of the error formatting on the winston side of the fence.

winstonjs/winston#1498

This makes me even more sure that we should just include a "suggested formatter" that covers errors, with a reference and reminder about this winston-level issue so that if/when it gets fixed or changed in winston, we're already compatible.

I haven't made any modifications to address your comments, but will do that tomorrow.

@jeremy-j-ackso
Copy link
Contributor Author

And apparently a possible fix for the error thing is sitting in a PR for the transport. Hopefully they'll merge it soon.

winstonjs/winston-transport#34

@jeremy-j-ackso
Copy link
Contributor Author

@schfkt I resolved some of the comments you had, but could use some more input from you on the ones that are still out there.

Also, I'm going to get those "suggested formatters" written up soon, since that seems like a good idea for people refactoring to use the updates.

Extended the readme to include instructions for using formatters to get
behavior that duplicates older version of `winston-graylog2`. Downside
is that it requires using logform@^2.1.0, which hasn't been added to
base winston yet.

Also included a little code for including the metadata in the log
output.

Lastly, I noticed that the winston documentation suggests wrapping the
call to the actual transport client in a setImmediate, so added that.
@jeremy-j-ackso
Copy link
Contributor Author

jeremy-j-ackso commented Jan 9, 2019

The Travis failure appears to be related to Node 6 not supporting the Rest Parameter.

For it to work with Node 4 or 6, Node would have to be invoked using the --harmony flag. This should work fine on Node 8 and higher. I think it might also be supported by Node 7, but it isn't an LTS, so I'm personally not super worried about 7 unless you guys are.

It looks like the specific feature I was using that caused Node 6 to not be happy was destructuring rest parameters, which MDN (at the link) says is not supported in Node 4 or 6.

@jeremy-j-ackso
Copy link
Contributor Author

@schfkt @odino Ready for some more reviews. We might be pretty much there.

jeremy-j-ackso and others added 5 commits January 8, 2019 22:34
Due to language support issues, requiring a minimum of Node 8.6.0.

Also modified travis to just do `npm install`, without `--dev`
option since `npm install` now defaults to installing both
`dependencies` and `devDependencies`.
@jeremy-j-ackso
Copy link
Contributor Author

@schfkt @odino Hi, just wondering if this is something we can work on wrapping up? Maybe review my additional changes that address the concerns @schfkt outlined?

@jeremy-j-ackso
Copy link
Contributor Author

@schfkt @odino Hey, just checking in again. Any chance we can get this moving soon?

@schfkt
Copy link
Collaborator

schfkt commented Jan 15, 2019

@jeremy-j-ackso Hi. Sorry, I didn't have much time last days. I'll try to look into it today or tomorrow.

package.json Outdated Show resolved Hide resolved
lib/winston-graylog2.js Outdated Show resolved Hide resolved
@schfkt
Copy link
Collaborator

schfkt commented Jan 17, 2019

@jeremy-j-ackso just a side note: please don't resolve conversations for me, that way I can miss something.

readme.md Outdated Show resolved Hide resolved
package.json Show resolved Hide resolved
@jeremy-j-ackso
Copy link
Contributor Author

@schfkt All set, back to you!

@schfkt
Copy link
Collaborator

schfkt commented Jan 22, 2019

@jeremy-j-ackso thanks for adding e2e tests! 👍

lib/winston-graylog2.js Outdated Show resolved Hide resolved
@schfkt
Copy link
Collaborator

schfkt commented Jan 28, 2019

@odino I've finished with the review. Everything looks good. One important thing: as soon as it gets merged we'll need to release another major version, since this PR has many breaking changes.

@odino odino merged commit 70c2688 into namshi:master Jan 28, 2019
@odino
Copy link
Contributor

odino commented Jan 28, 2019

We have v2.0.0 now -- thanks @schfkt for the extensive review and @jeremy-j-ackso for landing this! Great team work!

@schfkt schfkt mentioned this pull request Jan 28, 2019
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