8000 GitHub - unitymind/rollbax: Exception tracking and logging from Elixir to Rollbar
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Exception tracking and logging from Elixir to Rollbar

License

Notifications You must be signed in to change notification settings

unitymind/rollbax

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Rollbax Build Status

This is an Elixir client for the Rollbar service.

Installation

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

def application() do
  [applications: [:rollbax]]
end

defp deps() do
  [{:rollbax, "~> 0.5"}]
end

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

Configuration

It requires access_token and environment parameters to be set in your application environment, usually defined in your config/config.exs:

config :rollbax,
  access_token: "ffb8056a621f309eeb1ed87fa0c7",
  environment: "production"

Usage

try do
  DoesNotExist.for_sure()
rescue
  exception ->
    Rollbax.report(exception, System.stacktrace())
end

Notifier for Logger

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

config :logger,
  backends: [Rollbax.Notifier]

config :logger, Rollbax.Notifier,
  level: :error

The Rollbax log sending can be disabled by using Logger metadata:

Logger.metadata(rollbar: false)
# For a single call
Logger.error("oops", rollbar: false)

Non-production reporting

For non-production environments error reporting can be disabled or turned into logging:

config :rollbax, enabled: :log

License

This software is licensed under the ISC license.

About

Exception tracking and logging from Elixir to Rollbar

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Elixir 100.0%
0