summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2018-05-18 07:46:28 +0000
committerDouwe Maan <douwe@gitlab.com>2018-05-18 07:46:28 +0000
commit9f058e9ab10051720faa6bcce4b18b3ba86ebad5 (patch)
tree821ce99cf786982a286d839f71989156e56c25ea
parent1b9ff9db8171c54240f8eff228da6e905548d761 (diff)
parent6b98033d9120c7dfc5276f623e27e7af22dd7b88 (diff)
downloadgitlab-ce-9f058e9ab10051720faa6bcce4b18b3ba86ebad5.tar.gz
Merge branch 'sh-fix-grape-logging-status-code' into 'master'
Fix api_json.log not always reporting the right HTTP status code See merge request gitlab-org/gitlab-ce!19028
-rw-r--r--changelogs/unreleased/sh-fix-grape-logging-status-code.yml5
-rw-r--r--lib/api/api.rb17
2 files changed, 14 insertions, 8 deletions
diff --git a/changelogs/unreleased/sh-fix-grape-logging-status-code.yml b/changelogs/unreleased/sh-fix-grape-logging-status-code.yml
new file mode 100644
index 00000000000..aabf9a84bfb
--- /dev/null
+++ b/changelogs/unreleased/sh-fix-grape-logging-status-code.yml
@@ -0,0 +1,5 @@
+---
+title: Fix api_json.log not always reporting the right HTTP status code
+merge_request:
+author:
+type: fixed
diff --git a/lib/api/api.rb b/lib/api/api.rb
index 5139e869c71..2fbeaaffcfe 100644
--- a/lib/api/api.rb
+++ b/lib/api/api.rb
@@ -8,14 +8,15 @@ module API
PROJECT_ENDPOINT_REQUIREMENTS = { id: NO_SLASH_URL_PART_REGEX }.freeze
COMMIT_ENDPOINT_REQUIREMENTS = PROJECT_ENDPOINT_REQUIREMENTS.merge(sha: NO_SLASH_URL_PART_REGEX).freeze
- use GrapeLogging::Middleware::RequestLogger,
- logger: Logger.new(LOG_FILENAME),
- formatter: Gitlab::GrapeLogging::Formatters::LogrageWithTimestamp.new,
- include: [
- GrapeLogging::Loggers::FilterParameters.new,
- GrapeLogging::Loggers::ClientEnv.new,
- Gitlab::GrapeLogging::Loggers::UserLogger.new
- ]
+ insert_before Grape::Middleware::Error,
+ GrapeLogging::Middleware::RequestLogger,
+ logger: Logger.new(LOG_FILENAME),
+ formatter: Gitlab::GrapeLogging::Formatters::LogrageWithTimestamp.new,
+ include: [
+ GrapeLogging::Loggers::FilterParameters.new,
+ GrapeLogging::Loggers::ClientEnv.new,
+ Gitlab::GrapeLogging::Loggers::UserLogger.new
+ ]
allow_access_with_scope :api
prefix :api