diff --git a/Gemfile b/Gemfile index b5f2409b..471d4e51 100644 --- a/Gemfile +++ b/Gemfile @@ -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 diff --git a/Gemfile.lock b/Gemfile.lock index 1b6430bb..638c1672 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -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) @@ -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) @@ -266,6 +270,7 @@ DEPENDENCIES bugsnag-capistrano (< 2) codecov httpclient! + httplog license_finder (~> 5.8) license_finder_xml_reporter! lograge diff --git a/config/environments/development.rb b/config/environments/development.rb index 16650ca4..aa18750e 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -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 diff --git a/config/initializers/httplog.rb b/config/initializers/httplog.rb new file mode 100644 index 00000000..0c17547d --- /dev/null +++ b/config/initializers/httplog.rb @@ -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