serilog-contrib / serilog-sinks-slack

A simple (yet customizable) Slack logging sink for Serilog
MIT License
40 stars 28 forks source link

Add support for QueueLimit w/ IBatchedLogEventSink implementation, fixes #36 #38

Closed BrightSoul closed 2 years ago

BrightSoul commented 2 years ago

As suggested by the authors of PeriodicBatchingSink:

Implement `IBatchedLogEventSink` and use the `PeriodicBatchingSinkOptions` constructor.

This PR also adds support for the QueueLimit parameter. Its default value is 100000, i.e. the same value used by PeriodicBatchingSinkOptions. It cannot be null since this value is already used to indicate a limitless queue. Having it as a default would probably lead to high memory usages without the user knowing.

TrapperHell commented 2 years ago

Valid observations you've made there. I had failed to notice this. Quite unfortunate that it has to be done this way imo, but there must be a good reason why the PeriodicBatching suggests this.