loggly / node-loggly-bulk

A client implementation for Loggly in node.js
https://www.loggly.com/docs/node-js-logs/
Other
20 stars 19 forks source link

Writing to `console` should be optional or not happen at all #37

Closed DJphilomath closed 6 years ago

DJphilomath commented 6 years ago

Retry logic printouts should be done with a logging library or be optional. Those printouts pollute the general log and are impossible to move somewhere else.

log #218 - failed on error: Error: read ECONNRESET
log #218 - Trying again in 2000[ms], attempt no. 2
log #220 - failed on error: 500 Internal Server Error
log #220 - Trying again in 2000[ms], attempt no. 2
log #218 sent successfully after 2 retries
log #220 sent successfully after 2 retries
Shwetajain148 commented 6 years ago

Hi @DJphilomath, Good news here! I have released a new beta version of our winston-loggly-bulk library which handles your above request and works with winston V 2.4.x. If you are using winston 2.x then you can setup the library using the below command-

npm install winston-loggly-bulk@beta

If you are on winston V 3.x then please run below command to fetch 3.x compatible environment.

npm install https://github.com/loggly/winston-loggly-bulk.git#3.x --save

The winston-loggly-bulk's 3.x version is currently a RC package and I'm expecting feedback from our customers so that I can resolve all issues(if any) and then make a stable 3.x release.

Changes: I have disabled the network error console writing by default and created a flag variable which can be set to true (in your main app.js file) to enable error writing on console like below-

networkErrorsOnConsole: true

If you are interested in winston 3.x instruction then follow the link here.

Thanks.

DJphilomath commented 6 years ago

Perfect. I'll include in the next sprint and let you know how it goes.

Shwetajain148 commented 6 years ago

Sure @DJphilomath, thanks for your inputs.

Shwetajain148 commented 6 years ago

Hi @DJphilomath, Since I have already done with this issue and it seems to be resolved, I am going ahead and closing this one. Please feel free to put your comment/issue if any.

Thanks!