Skip to content

Commit 6cd46d7

Browse files
authored
Improve docs for Logger overload protection (#13855)
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]>
1 parent b8b7947 commit 6cd46d7

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

lib/logger/lib/logger.ex

+6-3
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,12 @@ defmodule Logger do
1919
* Formats and truncates messages on the client
2020
to avoid clogging `Logger` handlers.
2121
22-
* Alternates between sync and async modes to remain
23-
performant when required but also apply back-pressure
24-
when under stress.
22+
* Provides multiple forms of [overload protection](https://www.erlang.org/doc/apps/kernel/logger_chapter.html#protecting-the-handler-from-overload):
23+
* keeps track of its message queue and switches to sync mode to apply
24+
back pressure or even drop messages
25+
* limits the number of logs emitted defaulting to 500 per second
26+
* optionally allows to terminate and restart it if the message queue length
27+
or memory thresholds are exceeded
2528
2629
* Allows overriding the logging level for a specific module,
2730
application or process.

0 commit comments

Comments
 (0)