logdna / logger-node

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

feat(max-attempts): support retry limits #59

Closed emelski closed 2 years ago

emelski commented 2 years ago

Allow users to optionally specify a maximum number of attempts to send in case of retryable errors, instead of retrying indefinitely.

The logger will accept an integer "maxAttempts" option, which gives the total number of attempts (including the first) when retryable errors are encountered.

When the limit is reached, errors that would otherwise be considered retryable are instead treated as non-retryable.

If "maxAttempts" is negative (or not specified), the logger will continue to retry indefinitely.

Fixes: #58

logdnabot commented 2 years ago

:tada: This PR is included in version 2.5.0 :tada:

The release is available on:

Your semantic-release bot :package::rocket: