Skip to content

Commit

Permalink
Use debug level for logger when forwarding headers
Browse files Browse the repository at this point in the history
This changes the existing logging at info level to debug level to
prevent noisy logging.
  • Loading branch information
theseanything committed Jul 17, 2019
1 parent f51bcdd commit 766c3a8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

* Adds middleware to allow the header `X-Govuk-Authenticated-User-Organisation`
to be passed along to content-store.
* Changes logging level about header forwarding from info to debug

# 59.5.1

Expand Down
10 changes: 5 additions & 5 deletions lib/gds_api/railtie.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,27 +3,27 @@
module GdsApi
class Railtie < Rails::Railtie
initializer "gds_api.initialize_govuk_request_id_sniffer" do |app|
Rails.logger.info "Using middleware GdsApi::GovukHeaderSniffer to sniff for GOVUK-Request-Id header"
Rails.logger.debug "Using middleware GdsApi::GovukHeaderSniffer to sniff for GOVUK-Request-Id header"
app.middleware.use GdsApi::GovukHeaderSniffer, 'HTTP_GOVUK_REQUEST_ID'
end

initializer "gds_api.initialize_govuk_original_url_sniffer" do |app|
Rails.logger.info "Using middleware GdsApi::GovukHeaderSniffer to sniff for GOVUK-Original-Url header"
Rails.logger.debug "Using middleware GdsApi::GovukHeaderSniffer to sniff for GOVUK-Original-Url header"
app.middleware.use GdsApi::GovukHeaderSniffer, 'HTTP_GOVUK_ORIGINAL_URL'
end

initializer "gds_api.initialize_govuk_authenticated_user_sniffer" do |app|
Rails.logger.info "Using middleware GdsApi::GovukHeaderSniffer to sniff for X-Govuk-Authenticated-User header"
Rails.logger.debug "Using middleware GdsApi::GovukHeaderSniffer to sniff for X-Govuk-Authenticated-User header"
app.middleware.use GdsApi::GovukHeaderSniffer, 'HTTP_X_GOVUK_AUTHENTICATED_USER'
end

initializer "gds_api.initialize_govuk_authenticated_user_organisation_sniffer" do |app|
Rails.logger.info "Using middleware GdsApi::GovukHeaderSniffer to sniff for X-Govuk-Authenticated-User-Organisation header"
Rails.logger.debug "Using middleware GdsApi::GovukHeaderSniffer to sniff for X-Govuk-Authenticated-User-Organisation header"
app.middleware.use GdsApi::GovukHeaderSniffer, 'HTTP_X_GOVUK_AUTHENTICATED_USER_ORGANISATION'
end

initializer "gds_api.initialize_govuk_content_id_sniffer" do |app|
Rails.logger.info "Using middleware GdsApi::GovukHeaderSniffer to sniff for Govuk-Auth-Bypass-Id header"
Rails.logger.debug "Using middleware GdsApi::GovukHeaderSniffer to sniff for Govuk-Auth-Bypass-Id header"
app.middleware.use GdsApi::GovukHeaderSniffer, 'HTTP_GOVUK_AUTH_BYPASS_ID'
end
end
Expand Down

0 comments on commit 766c3a8

Please sign in to comment.