diff --git a/CHANGELOG.md b/CHANGELOG.md index 561f979..6e3b9da 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,6 +27,17 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Overhauled Makefile with comprehensive build automation - Upgraded Bundler version for improved dependency management - Refined file packaging configuration for better gem distribution +- Refined logger configuration for improved debugging: + - Disabled logging of headers in HTTP responses + - Turned off logging of errors in HTTP responses + - Set log level to debug consistently across all environments + - Removed production/debug environment-based log level logic +- Updated README documentation: + - Switched build and test instructions from rake to make commands + - Fixed typo in notifications reference for Prometheus monitoring section +- Updated additional dependencies: + - Upgraded net-http to version 0.8.0 for improved compatibility + - Bumped faraday-follow_redirects to require newer minor version ### Fixed diff --git a/Gemfile.lock b/Gemfile.lock index da048fd..b28cb1b 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -4,7 +4,7 @@ PATH data_services_api (1.6.1) faraday (~> 2.13, >= 2.13.0) faraday-encoding (~> 0.0, >= 0.0.6) - faraday-follow_redirects (~> 0.3, >= 0.3.0) + faraday-follow_redirects (~> 0.4, >= 0.4.0) faraday-retry (~> 2.0, >= 2.0) json (~> 2.0) yajl-ruby (~> 1.4) @@ -54,8 +54,8 @@ GEM mocha (2.8.0) ruby2_keywords (>= 0.0.5) mutex_m (0.3.0) - net-http (0.7.0) - uri + net-http (0.8.0) + uri (>= 0.11.1) ostruct (0.6.3) parallel (1.27.0) parser (3.3.10.0) diff --git a/README.md b/README.md index fbdce57..b1aadab 100644 --- a/README.md +++ b/README.md @@ -63,7 +63,7 @@ order for the gem to work._ Rubocop should not report any warnings: ```sh -$ rubocop +$ make lint Inspecting 21 files ..................... @@ -81,14 +81,14 @@ Once the API is started you can invoke the tests with the simple command below[^1]: ```sh -rake test +make test ``` You can also set the environment variable `API_URL` to point to a running instance of the HMLR Data API from a non-default port: ```sh -API_URL=http://localhost:8080 rake test +API_URL=http://localhost:8080 make test ``` _N.B If `API_URL` environment variable is not set it will default to @@ -129,7 +129,7 @@ At present, publishing is a manual step for Gem maintainers. The process is: ### Prometheus monitoring This gem integrates with Prometheus monitoring by emitting the following -`ActiveSupport::Notificaion`s: +`ActiveSupport::Notification`s: - `response.api` - API response, including status code and duration - `connection_failure.api` - failure to connect to the API, with exception diff --git a/data_services_api.gemspec b/data_services_api.gemspec index deaa05a..c52e3db 100644 --- a/data_services_api.gemspec +++ b/data_services_api.gemspec @@ -28,7 +28,7 @@ Gem::Specification.new do |spec| spec.add_dependency 'faraday', '~> 2.13', '>= 2.13.0' spec.add_dependency 'faraday-encoding', '~> 0.0', '>= 0.0.6' - spec.add_dependency 'faraday-follow_redirects', '~> 0.3', '>= 0.3.0' + spec.add_dependency 'faraday-follow_redirects', '~> 0.4', '>= 0.4.0' spec.add_dependency 'faraday-retry', '~> 2.0', '>= 2.0' spec.add_dependency 'json', '~> 2.0' spec.add_dependency 'yajl-ruby', '~> 1.4' diff --git a/lib/data_services_api/service.rb b/lib/data_services_api/service.rb index 492acbe..908cef4 100644 --- a/lib/data_services_api/service.rb +++ b/lib/data_services_api/service.rb @@ -280,13 +280,11 @@ def in_rails? def with_logger_in_rails(config) return config.response :logger unless in_rails? - level = Rails.env.production? ? :info : :debug - config.response :logger, Rails.logger, { - headers: true, + headers: false, bodies: false, - errors: true, - log_level: level.to_sym + errors: false, + log_level: :debug } end