Skip to content

Commit

Permalink
[gemfile] integrate httplog
Browse files Browse the repository at this point in the history
  • Loading branch information
mikz committed Jun 3, 2019
1 parent c1c44d0 commit ef801fd
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 0 deletions.
1 change: 1 addition & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ gem 'httpclient', github: 'mikz/httpclient', branch: 'ssl-env-cert'
gem 'oauth2'

gem 'lograge'
gem 'httplog'

gem 'message_bus' # for publishing notifications about integration status

Expand Down
5 changes: 5 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,9 @@ GEM
globalid (0.4.2)
activesupport (>= 4.2.0)
hashdiff (0.3.8)
httplog (1.3.0)
rack (>= 1.0)
rainbow (>= 2.0.0)
i18n (1.6.0)
concurrent-ruby (~> 1.0)
interception (0.5)
Expand Down Expand Up @@ -195,6 +198,7 @@ GEM
method_source
rake (>= 0.8.7)
thor (>= 0.19.0, < 2.0)
rainbow (3.0.0)
rake (12.3.2)
request_store (1.4.1)
rack (>= 1.4)
Expand Down Expand Up @@ -266,6 +270,7 @@ DEPENDENCIES
bugsnag-capistrano (< 2)
codecov
httpclient!
httplog
license_finder (~> 5.8)
license_finder_xml_reporter!
lograge
Expand Down
5 changes: 5 additions & 0 deletions config/environments/development.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,8 @@
# routes, locales, etc. This feature depends on the listen gem.
# config.file_watcher = ActiveSupport::EventedFileUpdateChecker
end

HttpLog.configure do |config|
config.json_log = false
config.color = true
end
33 changes: 33 additions & 0 deletions config/initializers/httplog.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
HttpLog.configure do |config|
# Enable or disable all logging
config.enabled = true

# You can assign a different logger
config.logger = Rails.logger
config.severity = Logger::Severity::DEBUG

# Tweak which parts of the HTTP cycle to log...
config.log_connect = true
config.log_request = true
config.log_headers = false
config.log_data = true
config.log_status = true
config.log_response = true
config.log_benchmark = true

# ...or log all request as a single line by setting this to `true`
config.compact_log = false

# You can also log in JSON format
config.json_log = false

# Prettify the output - see below
config.color = false

# Limit logging based on URL patterns
config.url_whitelist_pattern = nil
config.url_blacklist_pattern = nil

# Mask the values of sensitive requestparameters
config.filter_parameters = %w[password]
end

0 comments on commit ef801fd

Please sign in to comment.