logdna / logger-node

A nodejs logger client for LogDNA
MIT License
34 stars 17 forks source link

optionally limit retry attempts for retryable errors #58

Closed emelski closed 2 years ago

emelski commented 2 years ago

Currently the logger will indefinitely retry errors that are "retryable", such as socket connection failures or most 5xx-level HTTP errors. For some use cases it would be nice to be able to limit the number of attempts, converting the retryable error into a non-retryable error after the limit is reached. This would allow the application to decide how to handle the error condition, whether that means permanent failure or logging via some other mechanism or something else entirely. I propose adding a maxAttempts option, which if set specifies the total number of attempts to send -- so for example, maxAttempts set to 3 would see the initial attempt followed by up to two retry attempts, and fail the send if it was still not successful after that.

logdnabot commented 2 years ago

:tada: This issue has been resolved in version 2.5.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: