Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Log outgoing Net::HTTP requests

tag: 0.0.7

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 lib
Octocat-spinner-32 spec
Octocat-spinner-32 .gitignore
Octocat-spinner-32 .rspec
Octocat-spinner-32 Gemfile
Octocat-spinner-32 Gemfile.lock
Octocat-spinner-32 MIT-LICENSE
Octocat-spinner-32 README.rdoc
Octocat-spinner-32 Rakefile
Octocat-spinner-32 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 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

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.