Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
UberMouse committed Oct 3, 2017
1 parent 5c80b41 commit 29f6ef0
Showing 1 changed file with 22 additions and 4 deletions.
26 changes: 22 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -193,13 +193,11 @@ end
Custom data can be added to `track_exception` by passing a custom_data key in the second parameter hash.

```ruby

begin
# more lovely code
rescue Exception => e
Raygun.track_exception(e, custom_data: {my: 'custom data', goes: 'here'})
end

```

Custom data can also be specified globally either by setting `config.custom_data` to a hash
Expand Down Expand Up @@ -321,15 +319,35 @@ end

### Tags

Raygun allows you to tag error reports with any number of tags. In your Raygun.setup block, set `tags` to an array of strings to have those
set on any error reports sent by the gem.
Tags can be added to `track_exception` by passing a tags key in the second parameter hash.

```ruby
begin
# more lovely code
rescue Exception => e
Raygun.track_exception(e, tags: ['my', 'tags', 'go here')
end
```

Tags can also be specified globally either by setting `config.custom_data` to an array

```ruby
Raygun.setup do |config|
config.tags = ['heroku']
end
```

or to a proc, which gets passed the exception and environment hash. This proc _must_ return an array of strings

```ruby
Raygun.setup do |config|
config.api_key = "YOUR_RAYGUN_API_KEY"
config.tags do |e, env|
[env["SERVER_NAME"]]
end
end
```

### Resque Error Tracking

Raygun4Ruby also includes a Resque failure backend. You should include it inside your Resque initializer (usually something like `config/initializers/load_resque.rb`)
Expand Down

0 comments on commit 29f6ef0

Please sign in to comment.