viesti / timbre-json-appender

JSON appender for Timbre
MIT License
44 stars 11 forks source link

Log whenever fallbacks happen #37

Closed vemv closed 3 months ago

vemv commented 3 months ago

Per

https://github.com/viesti/timbre-json-appender/blob/ac259e3644ace04bfc97deb8550d90b6c14f3e0b/src/timbre_json_appender/core.clj#L180-L181

, there's a fallback.

While that's pretty sound, in practice in production I occasionally get text logging with no hint of what went wrong.

I'd suggest that the Throwable _t was passed to a customizable function, default no-op.

(Personally I would log it 1 out of 10 times or so)

WDYT?

Thanks - V

viesti commented 3 months ago

Sounds reasonable, I could take a stab at this, if you don't get to it first :)

viesti commented 3 months ago

Happened to have a moment, spiked out something: https://github.com/viesti/timbre-json-appender/commit/4999ace7d86f60de38e6d7e6272071db1cf73393

Could do release later, if this looks kosher.

vemv commented 3 months ago

Good morning, thanks much! Simple and effective.

Looking forward to a release.

viesti commented 3 months ago

Released the change as 0.2.13. Cheers!

vemv commented 3 months ago

🍻 trying it out