Giter VIP home page Giter VIP logo

rollbax's Introduction

Rollbax

Build Status Hex Version

Elixir client for Rollbar.

Installation

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

defp deps() do
  [{:rollbax, ">= 0.0.0"}]
end

Then run mix deps.get in your shell to fetch the dependencies. Add :rollbax to your list of :applications if you're not using :extra_applications.

Usage

Rollbax requires some configuration in order to work. For example, in config/config.exs:

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

Then, exceptions (errors, exits, and throws) can be reported to Rollbar using Rollbax.report/3:

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

For detailed information on configuration and usage, take a look at the online documentation.

Crash reports

Rollbax provides a way to automatically report crashes from OTP processes (GenServers, Tasks, and so on). It can be enabled with:

config :rollbax, enable_crash_reports: true

For more information, check out the documentation for Rollbax.Logger. If you had previously configured Rollbax.Logger to be a Logger backend (for example config :logger, backends: [Rollbax.Logger]), you will need to remove since Rollbax.Logger is not a Logger backend anymore and you will get crashes if you use it as such.

Plug and Phoenix

For examples on how to take advantage of Rollbax in Plug-based applications (including Phoenix applications), have a look at the "Using Rollbax in Plug-based applications" page in the documentation.

Non-production reporting

For non-production environments error reporting can be either disabled completely (by setting :enabled to false) or replaced with logging of exceptions (by setting :enabled to :log).

config :rollbax, enabled: :log

Contributing

To run tests, run $ mix test --no-start. The --no-start bit is important so that tests don't fail (because of the :rollbax application being started without an :access_token specifically).

When making changes to the code, adhere to this Elixir style guide.

Finally, thanks for contributing! :)

License

This software is licensed under the ISC license.

rollbax's People

Contributors

whatyouhide avatar lexmag avatar craig-day avatar simonwoolf avatar wojtekmach avatar ono avatar michalmuskala avatar oyvindfanebust avatar mjquinlan2000 avatar teamon avatar philss avatar novaugust avatar tigerwolf avatar jonrowe avatar janpieper avatar capablemonkey avatar cifer-y avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.