You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Right now the loggers only have access to the request and response_body, but it would be nice to have access to the status code as well. For now, we're working around the problem by storing the intended status code in the request.env, but this is not ideal.
Not sure the best way to support this without breaking compatibility of the parameters call in
The API helper `render_api_error!` previously would log a 400 error with
no details in `api_json.log`, which made it difficult to debug problems
in production. To fix this, we:
1. Store the intended status code in the request
environment. grape-logging doesn't pass this along to the loggers:
aserafin/grape_logging#71
2. In the logger, check the code. If it is 400, attach an `api_error`
field that contains the response from the server.
Closes https://gitlab.com/gitlab-org/gitlab/-/issues/214879
Right now the loggers only have access to the
request
andresponse_body
, but it would be nice to have access to the status code as well. For now, we're working around the problem by storing the intended status code in therequest.env
, but this is not ideal.Not sure the best way to support this without breaking compatibility of the
parameters
call ingrape_logging/lib/grape_logging/middleware/request_logger.rb
Line 140 in fd8d2d4
The text was updated successfully, but these errors were encountered: