-
Notifications
You must be signed in to change notification settings - Fork 81
Description
Hi!
Something I often struggle with is getting the log levels in production right. Either I get way too much noise, or run the risk of not having enough context to efficiently debug production errors.
One approach to improve this that I've used in the past is to do log sampling on a per-request-basis. It more or less works by buffering all log calls during the duration of the request, but only actually emits ~1% of requests' logs if nothing goes wrong. But, if a log line with level warn >= is logged, emit everything that's been buffered. This gives you the ability to use liberal debug logging in production while still keeping your log volumes at manageable levels.
I realize that this may very well be outside of the scope for this project, but wanted to open an issue for discussion!