Hrafn

Installation

Add Hrafn as a dependency to your mix.exs file:

def application do
  [applications: [:hrafn]]
end

defp deps do
  [{:hrafn, "~> 0.1.2"}]
end

Then run mix deps.get in your shell to fetch the dependencies.

Configuration

config :hrafn,
  dsn: "https://xxx:yyy@app.getsentry.com/12345",
  public_dsn: "https://xxx@app.getsentry.com/12345",
  logger_level: :error,
  environment: :prod,
  ignored_exceptions: [Ecto.NoResultsError, Phoenix.Router.NoRouteError]

Usage

Logger Backend

There is a Logger backend to send logs to the Sentry, which could be configured as follows:

config :logger,
  backends: [Hrafn.LoggerBackend]

Plug

defmodule YourApp.Router do
  use Phoenix.Router
  use Hrafn.Plug, otp_app: :your_app

  # ...
end

Attributions

This project is merely an extension and customization of the following projects: