Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Branch: master
Fetching contributors…

Cannot retrieve contributors at this time

38 lines (23 sloc) 0.939 kB

httplog

Log outgoing HTTP requests made from your application.

Installation

gem install httplog

Usage

require 'httplog'

Yup, that's it. By default, this will log all outgoing HTTP requests and their responses to $stdout on DEBUG level.

Configuration

You can override the following default options:

HttpLog.options[:logger]        = Logger.new($stdout)
HttpLog.options[:severity]      = Logger::Severity::DEBUG
HttpLog.options[:log_connect]   = true
HttpLog.options[:log_request]   = true
HttpLog.options[:log_data]      = true
HttpLog.options[:log_status]    = true
HttpLog.options[:log_response]  = true
HttpLog.options[:log_benchmark] = true

So if you want to use this in a Rails app:

# file: config/initializers/httplog.rb

HttpLog.options[:logger] = Rails.logger

Development

To run the tests install bundler and start a server on the localhost. Then simply run `bundle exec rake`

Jump to Line
Something went wrong with that request. Please try again.