Skip to content

Commit 7451f20

Browse files
committed
Improve docs around well known keys
1 parent 6b2d514 commit 7451f20

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

lib/logger_json.ex

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,13 @@ defmodule LoggerJSON do
6868
You can set some well-known metadata keys to be included in the log entry. The following keys are supported
6969
for all formatters:
7070
71-
* `:conn` - the `Plug.Conn` struct. This is useful when logging HTTP requests and responses,
72-
each formatter may use it differently.
73-
* `:crash_reason` - accepts a tuple where the first element is the exception struct
74-
and the second is the stacktrace. For example: `Logger.error("Exception!", crash_reason: {e, __STACKTRACE__})`.
75-
Each formatter may encode it differently.
71+
* `:conn` - the `Plug.Conn` struct, setting it will include the request and response details in the log entry;
72+
* `:crash_reason` - a tuple where the first element is the exception struct and the second is the stacktrace.
73+
For example: `Logger.error("Exception!", crash_reason: {e, __STACKTRACE__})`. Setting it will include the exception
74+
details in the log entry.
75+
76+
Formatters may encode the well-known metadata differently and support additional metadata keys, see the documentation
77+
of the formatter for more details.
7678
"""
7779
@log_levels [:error, :info, :debug, :emergency, :alert, :critical, :warning, :notice]
7880
@log_level_strings Enum.map(@log_levels, &to_string/1)

0 commit comments

Comments
 (0)