mirror of
https://gh.wpcy.net/https://github.com/discourse/discourse.git
synced 2026-05-05 12:46:33 +08:00
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.
18 lines
442 B
Ruby
18 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
|