diff options
author | Douwe Maan <douwe@gitlab.com> | 2018-05-18 07:46:28 +0000 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2018-05-18 07:46:28 +0000 |
commit | 9f058e9ab10051720faa6bcce4b18b3ba86ebad5 (patch) | |
tree | 821ce99cf786982a286d839f71989156e56c25ea /lib | |
parent | 1b9ff9db8171c54240f8eff228da6e905548d761 (diff) | |
parent | 6b98033d9120c7dfc5276f623e27e7af22dd7b88 (diff) | |
download | gitlab-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
Diffstat (limited to 'lib')
-rw-r--r-- | lib/api/api.rb | 17 |
1 files changed, 9 insertions, 8 deletions
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 |