Structured logging of raw STUN/TURN datagrams exchanged with clients.
What problem this solves
Protocol-level debugging (401/438 auth loops, missing attributes, transaction
correlation) needs a timeline of every datagram in both directions without
enabling full packet capture. Each line includes direction, peer, byte count,
framing hint, and a hex dump. Lines go to Logger.debug/1 and a dedicated
file via PacketLog.Writer so they can be grepped apart from general logs.
Toggle with :packet_log_enabled (default true). Write failures never crash
relay traffic.
RFCs
Summary
Functions
Logs a raw datagram received from a client.
Logs a raw datagram (STUN/TURN reply) sent to a client.
Functions
@spec incoming(binary(), :inet.ip_address() | nil, :inet.port_number() | nil) :: :ok
Logs a raw datagram received from a client.
@spec outgoing(iodata(), :inet.ip_address() | nil, :inet.port_number() | nil) :: :ok
Logs a raw datagram (STUN/TURN reply) sent to a client.