vectordotdev / timber-ruby

🌲 Great Ruby logging made easy.
https://timber.io
Other
154 stars 19 forks source link

Switch to using a FlushableDroppingSizedQueue for the HTTP log device #155

Closed binarylogic closed 7 years ago

binarylogic commented 7 years ago

This switches the default HTTP request queue to use a FlushableDroppingSizedQueue for the HTTP log device instead of a SizedQueue. In the event of extremely high volume logging data will be dropped instead of applying back pressure to your application. This is a better default policy for a vendor gem like Timber. It should be your decision to apply back pressure.

To implement the previous behaviour you can pass the request_queue option when instantiating the HTTP log device:

http_log_device = Timber::LogDevices::HTTP.new("my_timber_api_key", request_queue: SizedQueue.new(3))