- Notifications
You must be signed in to change notification settings - Fork51
Exception tracking and logging from Elixir to Rollbar
License
ForzaElixir/rollbax
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
Elixir client forRollbar.
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.
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.
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.
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.
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
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"
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! :)
This software is licensed underthe ISC license.
About
Exception tracking and logging from Elixir to Rollbar
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Packages0
Uh oh!
There was an error while loading.Please reload this page.