Sha256: 48a3f264ee808c6519c50f1eb5aaad7e86a9356189a272562f935c097b9f1597

Contents?: true

Size: 1.82 KB

Versions: 5

Compression:

Stored size: 1.82 KB

Contents

# Sentinel

This is a gem for ErrorReportApi server integration.

## Installation

Add this line to your application's Gemfile:

```ruby
gem 'sentinel_api'
```

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install sentinel_api

Add initializer file

    $ rails g sentinel_api:install

Don't forget to configure your ErrorReporterAPI server uri and method

## Usage

There are 3 methods, which produce 3 log level messages:
info, warn, error.

You can use this gem in 3 ways:
 * provide hash with 3 keys: message, info, tags
 * provide message, exception and tags - info would be made from exception's class message and backtrace
 * provide message and exception - no tags would be sent
 * provide only exception, exception message would be used, no tags
```ruby
SentinelApi.info({ message: 'your custom error message', info: 'system info or other information', tags: ['tag1', 'tag2']})
SentinelApi.warn('your message', exception, ['tag1', 'tag2'])
SentinelApi.error('your message', exception)
```

## Development

After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).

## Configuration

- Add the following environment variables:

  * ENV['SENTINEL_API_URI'] : The error reporter uri to receive the request params. Default is 'http://localhost:3000/reports'.
  * ENV['SENTINEL_API_METHOD'] : The api method to be used to communicate with the url. Default is 'post'.

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
logkeeper_api-0.0.9 README.md
logkeeper_api-0.0.8 README.md
logkeeper_api-0.0.7 README.md
logkeeper_api-0.0.6 README.md
logkeeper_api-0.0.5 README.md