Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Log outgoing Net::HTTP requests
Ruby
tag: remove

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib
spec
.gitignore
.rspec
Gemfile
Gemfile.lock
MIT-LICENSE
README.rdoc
Rakefile
httplog.gemspec

README.rdoc

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 Net::HTTP.request calls 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

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

# file: config/initializers/httplog.rb

HttpLog.options[:logger] = Rails.logger
Something went wrong with that request. Please try again.