log forwarded host
This commit is contained in:
parent
e2b48e2f5c
commit
76dd6337a2
@ -59,7 +59,7 @@ Rails.application.configure do
|
||||
.then { |logger| ActiveSupport::TaggedLogging.new(logger) }
|
||||
|
||||
# Prepend all log lines with the following tags.
|
||||
config.log_tags = %i[request_id host]
|
||||
config.log_tags = %i[request_id forwarded_host]
|
||||
|
||||
# Info include generic and useful information about system operation, but avoids logging too much
|
||||
# information to avoid inadvertent exposure of personally identifiable information (PII). If you
|
||||
|
8
config/initializers/log_tags.rb
Normal file
8
config/initializers/log_tags.rb
Normal file
@ -0,0 +1,8 @@
|
||||
# frozen_string_literal: true
|
||||
module RequestExtension
|
||||
def forwarded_host
|
||||
headers["X-Forwarded-Host"] || host
|
||||
end
|
||||
end
|
||||
|
||||
ActiveSupport.on_load(:action_dispatch_request) { include RequestExtension }
|
@ -1,5 +1,3 @@
|
||||
version: "3"
|
||||
|
||||
x-environment: &common-env
|
||||
WEBSITES_READONLY: "${READONLY:-0}"
|
||||
|
||||
|
@ -1,5 +1,3 @@
|
||||
version: "3"
|
||||
|
||||
x-environment: &common-env
|
||||
WEBSITES_READONLY: "${READONLY:-0}"
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user