Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/adjust/airbax
Exception tracking from Elixir to Airbrake
https://github.com/adjust/airbax
Last synced: about 1 month ago
JSON representation
Exception tracking from Elixir to Airbrake
- Host: GitHub
- URL: https://github.com/adjust/airbax
- Owner: adjust
- License: isc
- Fork: true (ForzaElixir/rollbax)
- Created: 2016-07-17T19:52:59.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-03-21T14:31:19.000Z (over 6 years ago)
- Last Synced: 2024-09-15T09:40:03.997Z (3 months ago)
- Language: Elixir
- Homepage:
- Size: 70.3 KB
- Stars: 5
- Watchers: 2
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- freaking_awesome_elixir - Elixir - Exception tracking from Elixir to Airbrake. (Third Party APIs)
- fucking-awesome-elixir - airbax - Exception tracking from Elixir to Airbrake. (Third Party APIs)
- awesome-elixir - airbax - Exception tracking from Elixir to Airbrake. (Third Party APIs)
README
# Airbax
[![Build Status](https://travis-ci.org/adjust/airbax.svg?branch=master "Build Status")](https://travis-ci.org/adjust/airbax)
[![Hex Version](https://img.shields.io/hexpm/v/airbax.svg "Hex Version")](https://hex.pm/packages/airbax)Elixir client for [Airbrake](https://airbrake.io).
Airbax is a clone of awesome [Rollbax](https://github.com/elixir-addicts/rollbax), but for Airbrake/Errbit.
Airbax was made by simply replacing 'rollbax' with 'airbax' everywhere in the code, changing
`Rollbax.Item` and `Rollbax.Client` to make them compatible with Airbrake API specifications
and fixing some tests. That's it.
All credits go to Rollbax.## Installation
Add Airbax as a dependency to your `mix.exs` file:
```elixir
defp deps() do
[{:airbax, "0.0.6"}]
end
```and add it to your list of applications:
```elixir
def application() do
[applications: [:airbax]]
end
```Then run `mix deps.get` in your shell to fetch the dependencies.
## Usage
Airbax requires some configuration in order to work. For example, in `config/config.exs`:
```elixir
config :airbax,
project_key: "ffb8056a621f309eeb1ed87fa0c7",
project_id: true,
environment: "production"
```If you're using Errbit, add to the configuration above an URL of your Errbit service as `url` parameter.
Then, exceptions (errors, exits, and throws) can be reported to Airbrake or Errbit using `Airbax.report/3`:
```elixir
try do
DoesNotExist.for_sure()
rescue
exception ->
Airbax.report(:error, exception, System.stacktrace())
end
```### Plug and Phoenix
For examples on how to take advantage of Airbax in Plug-based applications (including Phoenix applications), have a look at the ["Using Airbax in Plug-based applications" page in the documentation](http://hexdocs.pm/airbax/using-airbax-in-plug-based-applications.html).
### 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`).
```elixir
config :airbax, enabled: :log
```## License
This software is licensed under [the ISC license](LICENSE).