Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

tracker_hub-request

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tracker_hub-request

  • 1.0.1
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

Gem Version Build Status Code Climate Test Coverage Dependency Status Inline docs

TrackerHub::Request

Part of TrackerHub, Request is a gem tracking every requests on the backend side. Some keys will be filtered and the request data will finally be saved into a logfile. This logfile will be automatically managed and rotated by the logging gem.

Installation

Add this line to your application's Gemfile:

gem 'tracker_hub-request', git: 'git@github.com:SparkHub/gs-tracking-requests.git'

And then execute:

$ bundle

Configuration (optional)

In an initializer, you can configure the tracker:

# ./config/initializers/request_tracker.rb
TrackerHub::Request.setup do |config|
  config.app_version   = '1.0'
  config.required_keys = %w(my rack env keys to log)
  config.logger        = ActiveSupport::Logger.new('requests.log')
  config.notification  = TrackerHub::Request::Notification.new(TrackerHub::Request::Notification::HipChat.new('my_token', 'my_room', 'my_username'))
end

Note:

  • logger

Here you can define your own configured logger. The default logger is logging. Feel free to add your own, or use another gem!

  • notification

If an error occure, it will be catched and a notification will be sent to the service of your choice. The list of available services are defined here.

Usage

Add the middleware to your environment:

config.middleware.insert_after ActionDispatch::DebugExceptions, TrackerHub::Request::Middleware

Activate the TrackerHub by adding to your environment (or .env):

$ TRACKER=true

Get your request logs:

$ tail -f ./log/tracker/requests.log

Running tests

To run tests:

$ bundle exec rake spec

Contributing

Bug reports and pull request are welcome on GitHub at https://github.com/SparkHub/gs-tracking-requests. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.

License

The gem is available as open source under the terms of the MIT License.

FAQs

Package last updated on 08 Oct 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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc