MobDev.Server.ElixirLogger (mob_dev v0.5.8)

Copy Markdown View Source

OTP logger handler that captures Elixir Logger output and forwards it to the Mob dev server dashboard.

Attached by mix mob.server after the supervision tree starts, so ElixirLogBuffer and PubSub are guaranteed to be running.

Only captures events with domain: [:elixir] — the domain Elixir's Logger uses for all Logger.info/debug/warning/error calls. Raw :logger calls and OTP system messages are excluded.

Summary

Functions

Attach the handler to OTP's logger. Call after the server supervisor starts.

Detach the handler.

Functions

adding_handler(config)

@spec adding_handler(map()) :: {:ok, map()}

attach()

@spec attach() :: :ok | {:error, term()}

Attach the handler to OTP's logger. Call after the server supervisor starts.

detach()

@spec detach() :: :ok | {:error, term()}

Detach the handler.

log(event, config)

@spec log(map(), map()) :: :ok

removing_handler(config)

@spec removing_handler(map()) :: :ok