Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Register
  • Sign in
  • G gitlab-ce
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 1
    • Merge requests 1
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Metrics
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • nexedinexedi
  • gitlab-ce
  • Repository
You need to sign in or sign up before continuing.
  • gitlab-ce
  • lib
  • api
  • helpers.rb
Find file BlameHistoryPermalink
  • Stan Hu's avatar
    Log server responses of API bad requests in api_json.log · 7f139a74
    Stan Hu authored Apr 17, 2020
    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:
    https://github.com/aserafin/grape_logging/issues/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
    7f139a74
GitLab Nexedi Edition | About GitLab | About Nexedi | 沪ICP备2021021310号-2 | 沪ICP备2021021310号-7