DEV: Remove `git_version` from `DiscourseLogstashLogger` log event (#27730)
In our official Docker image, running git commands results in the following error: ``` fatal: detected dubious ownership in repository at '/var/www/discourse' To add an exception for this directory, call: git config --global --add safe.directory /var/www/discourse ```
This commit is contained in:
parent
72fd509fd4
commit
bb0daa33cd
|
@ -2,12 +2,10 @@
|
||||||
|
|
||||||
require "json"
|
require "json"
|
||||||
require "socket"
|
require "socket"
|
||||||
require_relative "git_utils"
|
|
||||||
|
|
||||||
class DiscourseLogstashLogger < Logger
|
class DiscourseLogstashLogger < Logger
|
||||||
PROCESS_PID = Process.pid
|
PROCESS_PID = Process.pid
|
||||||
HOST = Socket.gethostname
|
HOST = Socket.gethostname
|
||||||
GIT_VERSION = GitUtils.git_version
|
|
||||||
|
|
||||||
attr_accessor :customize_event, :type
|
attr_accessor :customize_event, :type
|
||||||
|
|
||||||
|
@ -67,7 +65,6 @@ class DiscourseLogstashLogger < Logger
|
||||||
"pid" => PROCESS_PID,
|
"pid" => PROCESS_PID,
|
||||||
"type" => @type.to_s,
|
"type" => @type.to_s,
|
||||||
"host" => HOST,
|
"host" => HOST,
|
||||||
"git_version" => GitUtils.git_version,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Only log backtrace and env for Logger::WARN and above.
|
# Only log backtrace and env for Logger::WARN and above.
|
||||||
|
|
|
@ -21,7 +21,6 @@ RSpec.describe DiscourseLogstashLogger do
|
||||||
"pid" => described_class::PROCESS_PID,
|
"pid" => described_class::PROCESS_PID,
|
||||||
"type" => "test",
|
"type" => "test",
|
||||||
"host" => described_class::HOST,
|
"host" => described_class::HOST,
|
||||||
"git_version" => described_class::GIT_VERSION,
|
|
||||||
"method" => "GET",
|
"method" => "GET",
|
||||||
"path" => "/",
|
"path" => "/",
|
||||||
"format" => "html",
|
"format" => "html",
|
||||||
|
|
Loading…
Reference in New Issue