Commit a73a1d24 authored by Sean McGivern's avatar Sean McGivern

Stop logging response field in Lograge

We had a `response` field in our logs from the ApplicationController,
which had some custom logging for the body of 422 responses to JSON
requests. We removed the custom logging in the controller, but not from
the Lograge configuration. This didn't cause a problem because the field
wasn't present and so wasn't logged, but Rails 6.1 added its own
`response` field to the log:
https://github.com/rails/rails/commit/b5c6f33f0d301d8766acb5e516defe4e4eae3119

That doesn't have a convenient string representation by default, which
meant we were logging things like this:

    "response": "#<ActionDispatch::Response:0x00007fcb384bc8b8>"
parent b93992b0
......@@ -25,7 +25,6 @@ module Gitlab
::Gitlab::InstrumentationHelper.add_instrumentation_data(payload)
payload[:queue_duration_s] = event.payload[:queue_duration_s] if event.payload[:queue_duration_s]
payload[:response] = event.payload[:response] if event.payload[:response]
payload[:etag_route] = event.payload[:etag_route] if event.payload[:etag_route]
payload[Labkit::Correlation::CorrelationId::LOG_KEY] = event.payload[Labkit::Correlation::CorrelationId::LOG_KEY] || Labkit::Correlation::CorrelationId.current_id
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment