Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Exception tracking and logging from Elixir to Rollbar

License

NotificationsYou must be signed in to change notification settings

ForzaElixir/rollbax

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build StatusHex Version

Elixir client forRollbar.

Installation

Add Rollbax as a dependency to yourmix.exs file:

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

Then runmix 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, inconfig/config.exs:

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

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

trydoDoesNotExist.for_sure()rescueexception->Rollbax.report(:error,exception,System.stacktrace())end

For detailed information on configuration and usage, take a look at theonline 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 forRollbax.Logger.If you had previously configuredRollbax.Logger to be a Logger backend (for exampleconfig :logger, backends: [Rollbax.Logger]), you will need to remove sinceRollbax.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 tofalse) or replaced with logging of exceptions (by setting:enabled to:log).

config:rollbax,enabled::log

Using a proxy to reach the Rollbar server

For environments which require a proxy to connect to hosts outside of the network, the:proxy config entry can be added with a proxy URL as it's defined in thehackney documentation.

config:rollbax,proxy:"https://my-secure-proxy:5001"

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 thisElixir style guide.

Finally, thanks for contributing! :)

License

This software is licensed underthe ISC license.

About

Exception tracking and logging from Elixir to Rollbar

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors26

Languages


[8]ページ先頭

©2009-2025 Movatter.jp