Skip to content

Commit

Permalink
Log STUN responses at 'debug' level only
Browse files Browse the repository at this point in the history
On busy servers, the amount of STUN queries can be overwhelming, so
don't log those at 'info' level.
  • Loading branch information
weiss committed Aug 30, 2020
1 parent be1d2fb commit d01c712
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

* Log relay allocation refreshes at notice level.
* Log duration of TURN sessions.
* Log STUN queries at debug (rather than info) level.
* Hand over more metadata to STUN callback.

# Version 1.0.37
Expand Down
4 changes: 2 additions & 2 deletions src/stun.erl
Original file line number Diff line number Diff line change
Expand Up @@ -299,10 +299,10 @@ process(State, #stun{class = request,
AddrPort = unmap_v4_addr(State#state.peer),
R = case stun_codec:version(Msg) of
old ->
?LOG_INFO("Responding to 'classic' STUN request"),
?LOG_DEBUG("Responding to 'classic' STUN request"),
Resp#stun{class = response, 'MAPPED-ADDRESS' = AddrPort};
new ->
?LOG_INFO("Responding to STUN request"),
?LOG_DEBUG("Responding to STUN request"),
Resp#stun{class = response, 'XOR-MAPPED-ADDRESS' = AddrPort}
end,
run_hook(stun_query, State, Msg),
Expand Down

0 comments on commit d01c712

Please sign in to comment.