Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
6 changes: 3 additions & 3 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ order for the gem to work._
Rubocop should not report any warnings:

```sh
$ rubocop
$ make lint
Inspecting 21 files
.....................

Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion data_services_api.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
8 changes: 3 additions & 5 deletions lib/data_services_api/service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down