# `Obscura.Phoenix.SocketLogger`
[🔗](https://github.com/hfiguera/obscura/blob/v0.2.0/lib/obscura/phoenix/socket_logger.ex#L1)

Privacy-safe logging for Phoenix socket connection and drain events.

This opt-in telemetry handler replaces the socket portion of Phoenix's
default logger after `config :phoenix, :logger, false` disables it. Connection
parameters are omitted by default. `connect_info` is never logged.

Add the handler to the application supervision tree:

    children = [
      {Obscura.Phoenix.SocketLogger, connect_params: :omit}
    ]

To include a bounded redacted copy of connection parameters, opt in to the
dependency-light `:fast` profile:

    {Obscura.Phoenix.SocketLogger,
     connect_params: {:redact, entities: [:email, :phone, :credit_card]}}

Model-backed profiles and custom realtime callbacks are intentionally not
accepted in this synchronous logging path. Parameter text above the fixed
4 KiB realtime analysis budget is logged as `[FILTERED]` without running PII
recognition. Structs and tuple-bearing terms, including keyword lists, also
fail closed without protocol dispatch.

# `child_spec`

Returns a specification to start this module under a supervisor.

See `Supervisor`.

# `start_link`

```elixir
@spec start_link(keyword()) :: GenServer.on_start()
```

Starts the Phoenix socket telemetry handler.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
