Skip to content

Commit

Permalink
Improve docs for Logger overload protection (#13855)
Browse files Browse the repository at this point in the history
The previous docs didn't mention that logger may drop messages
entirely. This should give a fair overview of the built-in overload
protections, similar to erlang/otp#8855.

---
Co-authored-by: Andrea Leopardi <[email protected]>
  • Loading branch information
PragTob authored Sep 24, 2024
1 parent b8b7947 commit 6cd46d7
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions lib/logger/lib/logger.ex
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,12 @@ defmodule Logger do
* Formats and truncates messages on the client
to avoid clogging `Logger` handlers.
* Alternates between sync and async modes to remain
performant when required but also apply back-pressure
when under stress.
* Provides multiple forms of [overload protection](https://www.erlang.org/doc/apps/kernel/logger_chapter.html#protecting-the-handler-from-overload):
* keeps track of its message queue and switches to sync mode to apply
back pressure or even drop messages
* limits the number of logs emitted defaulting to 500 per second
* optionally allows to terminate and restart it if the message queue length
or memory thresholds are exceeded
* Allows overriding the logging level for a specific module,
application or process.
Expand Down

0 comments on commit 6cd46d7

Please sign in to comment.