Skip to content
Provides a `Logger` backend for Sentry, to automatically submit Logger events above a configurable threshold to Sentry
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
config
lib
.gitignore
README.md
mix.exs
mix.lock

README.md

SentryLoggerBackend

Provides a Logger backend for Sentry, to automatically submit Logger events above a configurable threshold to Sentry

Installation

  1. Add sentry_logger_backend to your list of dependencies in mix.exs:
def deps do
  [{:sentry_logger_backend, "~> 0.1.0"}]
end
  1. Add SentryLoggerBackend to the list of logger backends in your config, e.g.
config :logger, backends: [:console, SentryLoggerBackend]
  1. Set the level threshold (defaults to :error - but see warning below):
config :logger, SentryLoggerBackend, level: :error

Please note if setting level to :warn, :info, or :debug

The current version of elixir-sentry logs problems encountered while posting to sentry at the :warn level.

That means that if you configure the level threshold to anything other than :error, and there's a problem posting to sentry, then this can result in an infinite loop of error-posting attempts.

The suggested solution for now, if you want to use a threshold other than :error, is to use my fork of sentry-elixir, which adds :skip_sentry metadata to that logger call. Future plans are to include a custom http client in sentry-logger-backend, see https://github.com/SimonWoolf/sentry-logger-backend/issues/1 .

License

This project is licensed under the MIT License.

You can’t perform that action at this time.