serilog / serilog-sinks-periodicbatching

Infrastructure for Serilog sinks that process events in batches.
Apache License 2.0
73 stars 29 forks source link

Aenima4six2/enqueue fail #33

Closed Aenima4six2 closed 3 years ago

Aenima4six2 commented 5 years ago

Allows derived sinks to take action when a log event could not be queued

nblumhardt commented 5 years ago

Thanks for the PR. Where would this currently be consumed? Is the main goal to get the event onto SelfLog, or is there a sink out there that will override OnEnqueued()? Thanks!

Aenima4six2 commented 5 years ago

Thanks for the PR. Where would this currently be consumed? Is the main goal to get the event onto SelfLog, or is there a sink out there that will override OnEnqueued()? Thanks!

Very welcome! The primary goal in my use case is to override OnEnqueued() and track/instrument how many messages are missed on average. This is useful for tuning the batch size, queue size and batch period. Additionally, I was hoping to get an extension point to log this scenario to some kind of fall back or lower priority log (stderr, dead letter q, etc)

nblumhardt commented 5 years ago

Thanks for the follow-up. I think it'd be interesting to look at the work/downstream support for exposing the OnEnqueued() hook - it'd need to be opted-into by every derived sink that wants to work with it, and sometimes these things take a bit of time and effort.

Would your scenario still be covered, or be able to be worked around, via the SelfLog only?

Aenima4six2 commented 5 years ago

SelfLog only wouldn't cover all of my specific needs, but it would provide at minimum, useful insight into when logs are being dropped. Optimally, I'd like to be able to take action when log events are dropped.