summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-08-02 21:29:46 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2021-08-02 21:30:06 +0000
commitf8be3ab1ff947a0a6e080a9af0c5b97274963436 (patch)
treeb8ab4a1a2c3d4be870ab6a4107d3be794eb6d296
parent35a9ba2148ce4cb992e6f69e8797891d507ecbd5 (diff)
downloadgitlab-ce-f8be3ab1ff947a0a6e080a9af0c5b97274963436.tar.gz
Add latest changes from gitlab-org/security/gitlab@14-1-stable-ee
-rw-r--r--config/initializers/omniauth.rb4
-rw-r--r--lib/gitlab/omniauth_logging/json_formatter.rb13
-rw-r--r--spec/lib/gitlab/omniauth_logging/json_formatter_spec.rb12
3 files changed, 1 insertions, 28 deletions
diff --git a/config/initializers/omniauth.rb b/config/initializers/omniauth.rb
index 85984772d05..478a5828809 100644
--- a/config/initializers/omniauth.rb
+++ b/config/initializers/omniauth.rb
@@ -19,6 +19,4 @@ OmniAuth.config.before_request_phase do |env|
Gitlab::RequestForgeryProtection.call(env)
end
-# Use json formatter
-OmniAuth.config.logger.formatter = Gitlab::OmniauthLogging::JSONFormatter.new
-OmniAuth.config.logger.level = Logger::ERROR if Rails.env.production?
+OmniAuth.config.logger = Gitlab::AppLogger
diff --git a/lib/gitlab/omniauth_logging/json_formatter.rb b/lib/gitlab/omniauth_logging/json_formatter.rb
deleted file mode 100644
index cdd4da31803..00000000000
--- a/lib/gitlab/omniauth_logging/json_formatter.rb
+++ /dev/null
@@ -1,13 +0,0 @@
-# frozen_string_literal: true
-
-require 'json'
-
-module Gitlab
- module OmniauthLogging
- class JSONFormatter
- def call(severity, datetime, progname, msg)
- { severity: severity, timestamp: datetime.utc.iso8601(3), pid: $$, progname: progname, message: msg }.to_json << "\n"
- end
- end
- end
-end
diff --git a/spec/lib/gitlab/omniauth_logging/json_formatter_spec.rb b/spec/lib/gitlab/omniauth_logging/json_formatter_spec.rb
deleted file mode 100644
index f65b247d5d7..00000000000
--- a/spec/lib/gitlab/omniauth_logging/json_formatter_spec.rb
+++ /dev/null
@@ -1,12 +0,0 @@
-# frozen_string_literal: true
-
-require 'spec_helper'
-
-RSpec.describe Gitlab::OmniauthLogging::JSONFormatter do
- it "generates log in json format" do
- Timecop.freeze(Time.utc(2019, 12, 04, 9, 10, 11, 123456)) do
- expect(subject.call(:info, Time.now, 'omniauth', 'log message'))
- .to eq %Q({"severity":"info","timestamp":"2019-12-04T09:10:11.123Z","pid":#{Process.pid},"progname":"omniauth","message":"log message"}\n)
- end
- end
-end