Our logs in production are sent to the Network target (https://github.com/NLog/NLog/wiki/Network-target), which then forwards the log messages to logstash. There was a bug in our production code that got into a tight loop writing out messages continuously (over a one hour period about 10GB or logs were written). We've fixed this bug; however, would like to gracefully deal with similar situations in the future.
What is the best option to implement a basic rate limiter?
Do I write a custom target and wraps around the network target or do I write a wrapper?
What's the difference between a wrapper and a target?
Any feedback would be greatly appreciated!