Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarify log level for Phoenix.Channel #5785

Merged
merged 2 commits into from May 2, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 7 additions & 4 deletions lib/phoenix/channel.ex
Expand Up @@ -335,14 +335,17 @@ defmodule Phoenix.Channel do
## Logging

By default, channel `"join"` and `"handle_in"` events are logged, using
the level `:info` and `:debug`, respectively. Logs can be customized per
event type or disabled by setting the `:log_join` and `:log_handle_in`
options when using `Phoenix.Channel`. For example, the following
configuration logs join events as `:info`, but disables logging for
the level `:info` and `:debug`, respectively. You can change the level used
for each event, or disable logs, per event type by setting the `:log_join`
and `:log_handle_in` options when using `Phoenix.Channel`. For example, the
following configuration logs join events as `:info`, but disables logging for
incoming events:

use Phoenix.Channel, log_join: :info, log_handle_in: false

Note that changing an event type's level doesn't affect what is logged,
unless you set it to `false`; it affects the associated level.
josevalim marked this conversation as resolved.
Show resolved Hide resolved

josevalim marked this conversation as resolved.
Show resolved Hide resolved
"""
alias Phoenix.Socket
alias Phoenix.Channel.Server
Expand Down