Skip to content

Commit

Permalink
Describe why Logger.flush is not advised in production
Browse files Browse the repository at this point in the history
  • Loading branch information
josevalim committed Dec 5, 2024
1 parent 4328b09 commit b75cccc
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/logger/lib/logger.ex
Original file line number Diff line number Diff line change
Expand Up @@ -702,8 +702,11 @@ defmodule Logger do
@doc """
Flushes the logger.
This guarantees all log handlers are flushed. This is useful
for testing and it should not be called in production code.
This guarantees all logger handlers flush to disk or storage.
This is useful for testing but it should be avoided in production,
as it could force logger handlers to drop whatever they are doing
and flush, even if continuing to buffer would be the most peformant
option.
"""
@spec flush :: :ok
def flush do
Expand Down

0 comments on commit b75cccc

Please sign in to comment.