warpstreamlabs / bento

Fancy stream processing made operationally mundane. This repository is a fork of the original project before the license was changed.
https://warpstreamlabs.github.io/bento/
Other
1.07k stars 71 forks source link

add: log all errors wrapper for Logger component #143

Closed gregfurman closed 2 weeks ago

gregfurman commented 1 month ago

Adds an optional wrapped logger that will promote any log with an error type to the ERROR level.

This does not include ading an error in a logger's With or WithField.

For example, if you set:

logger:
    log_all_errors: true

Then any subsequent logger calling Warn, Info,Debug, Trace, or with an error type in the params will promote the log to an Error type.

In addition, a field @log_all_errors=true is added to all logs generated from the strict logger:

level=error msg="Trace message root module: fail"  @log_all_errors=true @service=bento_service
jem-davies commented 4 weeks ago

I acknowledge the request for review - will give it a good look soon 👍