summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2019-07-12 12:13:28 -0700
committerStan Hu <stanhu@gmail.com>2019-07-14 20:53:54 -0700
commit0ffac1ab27776d4bd68b552ca0e57fb8c9dfb40a (patch)
tree52f562bb5300c682ab4bd4e16fc62ff1f9a40e8c
parentb1ef2da4827816accb63f46b7b07903e3d29d7a4 (diff)
downloadgitlab-ce-0ffac1ab27776d4bd68b552ca0e57fb8c9dfb40a.tar.gz
Filter Geo proxied data from api_json.logsh-filter-geo-output
Currently the base64-encoded value of the push-to-secondary data is saved in `api_json.log`, and this can easily be hundreds of megabytes. We should filter this from the logs.
-rw-r--r--lib/api/api.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/api/api.rb b/lib/api/api.rb
index 574934d7f90..223ae13bd2d 100644
--- a/lib/api/api.rb
+++ b/lib/api/api.rb
@@ -10,13 +10,14 @@ module API
NAMESPACE_OR_PROJECT_REQUIREMENTS = { id: NO_SLASH_URL_PART_REGEX }.freeze
COMMIT_ENDPOINT_REQUIREMENTS = NAMESPACE_OR_PROJECT_REQUIREMENTS.merge(sha: NO_SLASH_URL_PART_REGEX).freeze
USER_REQUIREMENTS = { user_id: NO_SLASH_URL_PART_REGEX }.freeze
+ LOG_FILTERS = ::Rails.application.config.filter_parameters + [/^output$/]
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::FilterParameters.new(LOG_FILTERS),
GrapeLogging::Loggers::ClientEnv.new,
Gitlab::GrapeLogging::Loggers::RouteLogger.new,
Gitlab::GrapeLogging::Loggers::UserLogger.new,