Socket
Book a DemoInstallSign in
Socket

exes_poster

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

exes_poster

bundlerRubygems
Version
0.1.0
Version published
Maintainers
1
Created
Source

ExesPoster

ExesPoster is an exception post tool to Elasticsearch.

Installation

Add this line to your application's Gemfile:

gem 'exes_poster'

And then execute:

$ bundle

Or install it yourself as:

$ gem install exes_poster

Getting Started

  • To set an environment variable "ELASTICSEARCH_URL"
$ export ELASTICSEARCH_URL=localhost:9200
  • Call ExesPoster.post_exception with caught exception in the rescue section.
require 'exes_poster'

begin
    raise RuntimeError, 'hoge'
rescue => e
    ExesPoster.post_exception(e)
end
  • You can find exception information at your elasticsearch.
{
  "_index"   : "exes_index",
  "_type"    : "exception",
  "_id"      : "eIb4VGPbRB6tw0eGnUXUXA",
  "_version" : 1,
  "found"    : true,
  "_source"  : {
    "message"    : "hoge",
    "@timestamp" : "2016-09-21T16:28:09.753+09:00",
    "detail"     : {
      "class"     : "RuntimeError",
      "backtrace" : [
        "/PATH/TO/ERROR/FILE1.rb:123:in `block (3 levels) in <top (required)>'",
        "/PATH/TO/ERROR/FILE2.rb:456:in `block (2 levels) in function'",
        "/PATH/TO/ERROR/FILE3.rb:15:in `<main>'"
      ]
    }
  }
}

in Japanese

  • 使い方

Configuration

You can set Elasticsearch url and index name.

ExesPoster.setup do |config|
  config.es_url   = 'example.com:9200'
  config.es_index = 'hoge_test'
end

Test

  • You set an environment variable DOCKER_HOST or ELASTICSEARCH_URL
$ export ELASTICSEARCH_URL=localhost:9200

or

$ eval $(docker-machine env default)
  • Then exec rake
$ bundle exec rake

FAQs

Package last updated on 22 Sep 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts