diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-11 03:09:06 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-02-11 03:09:06 +0300 |
commit | a9104a50136e485c8dda7af37106332f9010a1e8 (patch) | |
tree | 26880b70033a0952d7801c9554b99cea827820dd /config/initializers/snowplow_tracker.rb | |
parent | 696b36294520f8a311586f99e838b6a61b1b3f32 (diff) |
Add latest changes from gitlab-org/gitlab@master76926-follow-up-from-resolve-multi-selection-for-delete-on-registry-page
Diffstat (limited to 'config/initializers/snowplow_tracker.rb')
-rw-r--r-- | config/initializers/snowplow_tracker.rb | 23 |
1 files changed, 7 insertions, 16 deletions
diff --git a/config/initializers/snowplow_tracker.rb b/config/initializers/snowplow_tracker.rb index 3c730e03738..fadedc97d83 100644 --- a/config/initializers/snowplow_tracker.rb +++ b/config/initializers/snowplow_tracker.rb @@ -3,21 +3,12 @@ # Gitlab.com uses Snowplow for identifying users and events. # https://gitlab.com/gitlab-org/gitlab/issues/6329 # -# SnowplowTracker write log into STDERR +# SnowplowTracker writes logs to STDERR: # https://github.com/snowplow/snowplow-ruby-tracker/blob/39fcfa2be793f2e25e73087a9700abc93f43b5e8/lib/snowplow-tracker/emitters.rb#L23 -# `LOGGER = Logger.new(STDERR)` -# -# In puma.rb, if `stdout_redirect` specify stderr, Puma will overwrite STDERR in: -# https://github.com/puma/puma/blob/b41205f5cacbc2ad0060472bdce68ba636f42175/lib/puma/runner.rb#L134 -# `STDERR.reopen stderr, (append ? "a" : "w")` -# As a result, SnowplowTracker will log into Puma stderr, when Puma enabled. -# -# By default, SnowplowTracker uses default log formatter. -# When enable Puma, SnowplowTracker log is expected to be JSON format, as part of puma_stderr.log. -# Hence overwrite ::SnowplowTracker::LOGGER.formatter to JSON formatter - -if defined?(::Puma) && defined?(::SnowplowTracker::LOGGER) - ::SnowplowTracker::LOGGER.formatter = proc do |severity, datetime, progname, msg| - { severity: severity, timestamp: datetime.utc.iso8601(3), pid: $$, progname: progname, message: msg }.to_json << "\n" - end +if defined?(::SnowplowTracker::LOGGER) + # This squelches the output of the logger since it doesn't really + # provide useful information. + # https://github.com/snowplow/snowplow-ruby-tracker/pull/109 + # would make it possible to configure this logger directly. + ::SnowplowTracker::LOGGER.level = Logger::FATAL end |