Collector.LoggerHandler (collector v0.1.1)

Copy Markdown

An Erlang :logger handler that reports crashes and records breadcrumbs.

Elixir logs every crash with a crash_reason: processes, Tasks, GenServers, and the errors Plug and Phoenix (LiveView included) report for a request. Those become events. Everything else at info level and above becomes a breadcrumb of the process that logged it.

Exceptions that Plug maps to a 4xx status (Ecto.NoResultsError, Phoenix.Router.NoRouteError and the like) are the client's mistake, not a bug, so they aren't reported, even when they crash a LiveView.

The handler runs in the process that logged, so it never lets an error of its own escape into the app.

Summary

Functions

Adds the handler. Options: :id (default :collector), :sender (default Collector.Sender).

Functions

attach(opts \\ [])

Adds the handler. Options: :id (default :collector), :sender (default Collector.Sender).