Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
Print an error to console when fails to deliver a log event to Loggly #66
Conversation
|
+1 |
1 similar comment
|
+1 |
|
@alfasin , have you tested this change yourself? Because I was testing various possible errors such as 403, 502, 404 and only 404 (not found) triggers the code you added. 502 error causes retries that log something like (notice "attemptNumber":2 that increases with each retry):
and 403 logs
bub none of these run through the callback you modified. |
|
@Katulus you're right: I tested it by starting to run the project and disconnect the wifi, the error I got is ENOTFOUND Sounds like there are other cases that are not handled there, any idea how those cases should be handled? Could it be that these changes are needed to be implemented in node-loggly-bulk instead of here?. |
|
@alfasin , correct, node-loggly-bulk sends logs via this method or this method and it does most of error handling there. As you can see it does retry for most of the errors so if you get for example 502 from Loggly randomly then this retry logic should handle that and send the logs eventually. I'm not sure if it's a good idea to add fixed logging there since most of those intermittent errors are handled by retry logic. If you really want to be notified I would do that via some optional callback where you can do your own logging in your application. |
|
@Katulus sounds good! |
|
@alfasin , it's not something you can easily do today. There is no API for that since it's hidden behind Winston Transport anyway. You don't have direct access to it, you would have to expose it in some way. |
|
@Katulus if you have access to the support tickets in Loggly you'll be able to see all the details in Case # - 00566904. We know that for sure because:
It already happened a few times, it happens ~ once every 3-4 days in that example. And we saw other examples as well. This is the motivation for having a console.err print when all retries got exhausted or if anything else "bad" happened. WDYT? |
|
@alfasin , can you hardcode the logging on your side by direct modification of locally downloaded node module in your app? I'm OK with adding extra logging if we know it provides the value, but so far it's more "trial and error" so I'd like to avoid doing it in official released version. |
|
@Katulus this is not trial and error, further, printing error to console when failing is something that makes sense to do and as I showed above, PT are doing it as well. Changing code under node_modules is not an option I have. |
|
@alfasin that's a fair statement. Let's move on with this PR then. Are you going to create PR for node-loggly-bulk as well to cover more error states? |
|
Yes I'm looking into it as well, I'll ping you when I do. Thanks a bunch! |
|
@Katulus can we merge this PR? |
|
@alfasin , sorry, I was on PTO last week. I just merged the PR and released the new version 3.1.1 with the change. |

We experienced issues were many log events are missing in Loggly control-panel.
Hippo would appreciate it if you can pick up this PR in order for us to be able to debug it on our side and see if the failures are due to network errors or if the logs were submitted properly and failed to get digested on Loggly's side.
This is also implemented in PT transport:
https://github.com/kenperkins/winston-papertrail/blob/master/lib/winston-papertrail.js#L482
and would probably help other users debug issues in the future!