Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-04-07 12:09:13 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-04-07 12:09:13 +0300
commit41cb558299b483b44b45351730ee4c0e9fe4ca2c (patch)
tree00688a9e40021c66195ad826ceddd9c19385cdcf /lib/gitlab/sidekiq_logging
parent3d064c737e8448880e6180aeddc59000a01aa6a8 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/gitlab/sidekiq_logging')
-rw-r--r--lib/gitlab/sidekiq_logging/json_formatter.rb5
-rw-r--r--lib/gitlab/sidekiq_logging/logs_jobs.rb2
2 files changed, 6 insertions, 1 deletions
diff --git a/lib/gitlab/sidekiq_logging/json_formatter.rb b/lib/gitlab/sidekiq_logging/json_formatter.rb
index c20e929ae36..45c6842c59b 100644
--- a/lib/gitlab/sidekiq_logging/json_formatter.rb
+++ b/lib/gitlab/sidekiq_logging/json_formatter.rb
@@ -19,6 +19,7 @@ module Gitlab
output[:message] = data
when Hash
convert_to_iso8601!(data)
+ stringify_args!(data)
output.merge!(data)
end
@@ -39,6 +40,10 @@ module Gitlab
Time.at(timestamp).utc.iso8601(3)
end
+
+ def stringify_args!(payload)
+ payload['args'] = Gitlab::Utils::LogLimitedArray.log_limited_array(payload['args'].map(&:to_s)) if payload['args']
+ end
end
end
end
diff --git a/lib/gitlab/sidekiq_logging/logs_jobs.rb b/lib/gitlab/sidekiq_logging/logs_jobs.rb
index 55d711c54ae..326dfdae661 100644
--- a/lib/gitlab/sidekiq_logging/logs_jobs.rb
+++ b/lib/gitlab/sidekiq_logging/logs_jobs.rb
@@ -7,6 +7,7 @@ module Gitlab
"#{payload['class']} JID-#{payload['jid']}"
end
+ # NOTE: Arguments are truncated/stringified in sidekiq_logging/json_formatter.rb
def parse_job(job)
# Error information from the previous try is in the payload for
# displaying in the Sidekiq UI, but is very confusing in logs!
@@ -16,7 +17,6 @@ module Gitlab
job['pid'] = ::Process.pid
job.delete('args') unless ENV['SIDEKIQ_LOG_ARGUMENTS']
- job['args'] = Gitlab::Utils::LogLimitedArray.log_limited_array(job['args'].map(&:to_s)) if job['args']
job
end