mirror of
https://github.com/discourse/discourse.git
synced 2024-11-25 19:43:44 +08:00
006169f782
This is a duplicate of the `host` field which means we are bloating the logs unnecessarily. Just remove without depreciation for now but we are open to properly depreciating it if others depend on this field.
19 lines
442 B
Ruby
19 lines
442 B
Ruby
# frozen_string_literal: true
|
|
|
|
require "logstash-logger"
|
|
|
|
class DiscourseLogstashLogger
|
|
def self.logger(uri:, type:)
|
|
LogStashLogger.new(
|
|
uri: uri,
|
|
sync: true,
|
|
customize_event: ->(event) do
|
|
event["severity_name"] = event["severity"]
|
|
event["severity"] = Object.const_get("Logger::Severity::#{event["severity"]}")
|
|
event["type"] = type
|
|
event["pid"] = Process.pid
|
|
end,
|
|
)
|
|
end
|
|
end
|