Obscura.Phoenix.SocketLogger (obscura v0.1.3)

Copy Markdown View Source

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.

Summary

Functions

Returns a specification to start this module under a supervisor.

Starts the Phoenix socket telemetry handler.

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

start_link(opts \\ [])

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

Starts the Phoenix socket telemetry handler.