From 4909bbf415ca02093d0223d0d478eb06cb5cf78b Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Sun, 2 Oct 2016 14:58:06 +0200 Subject: [PATCH] Add logging for outgoing http requests --- Gemfile | 1 + Gemfile.lock | 4 ++++ app/assets/javascripts/about.coffee | 3 --- config/initializers/httplog.rb | 3 +++ 4 files changed, 8 insertions(+), 3 deletions(-) delete mode 100644 app/assets/javascripts/about.coffee create mode 100644 config/initializers/httplog.rb diff --git a/Gemfile b/Gemfile index c89b8d4f95..cf9b34cea2 100644 --- a/Gemfile +++ b/Gemfile @@ -19,6 +19,7 @@ gem 'paperclip', '~> 4.3' gem 'paperclip-av-transcoder' gem 'http' +gem 'httplog' gem 'addressable' gem 'nokogiri' gem 'link_header' diff --git a/Gemfile.lock b/Gemfile.lock index a4d87124fa..82e3bdaf4f 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -74,6 +74,7 @@ GEM coffee-script-source execjs coffee-script-source (1.10.0) + colorize (0.8.1) concurrent-ruby (1.0.2) connection_pool (2.2.0) crack (0.4.3) @@ -131,6 +132,8 @@ GEM domain_name (~> 0.5) http-form_data (1.0.1) http_parser.rb (0.6.0) + httplog (0.3.2) + colorize i18n (0.7.0) jbuilder (2.6.0) activesupport (>= 3.0.0, < 5.1) @@ -360,6 +363,7 @@ DEPENDENCIES hiredis htmlentities http + httplog jbuilder (~> 2.0) jquery-rails letter_opener diff --git a/app/assets/javascripts/about.coffee b/app/assets/javascripts/about.coffee deleted file mode 100644 index 24f83d18bb..0000000000 --- a/app/assets/javascripts/about.coffee +++ /dev/null @@ -1,3 +0,0 @@ -# Place all the behaviors and hooks related to the matching controller here. -# All this logic will automatically be available in application.js. -# You can use CoffeeScript in this file: http://coffeescript.org/ diff --git a/config/initializers/httplog.rb b/config/initializers/httplog.rb new file mode 100644 index 0000000000..37f113d5db --- /dev/null +++ b/config/initializers/httplog.rb @@ -0,0 +1,3 @@ +HttpLog.options[:logger] = Rails.logger +HttpLog.options[:color] = { color: :yellow } +HttpLog.options[:compact_log] = true