From 0c62a98b5e3c036635b7ca7f64df1d7044fb951d Mon Sep 17 00:00:00 2001 From: "Philipp, Zagar" Date: Tue, 3 Aug 2021 14:35:02 +0200 Subject: [PATCH] Add logger label to data sent to Logstash --- Sources/LoggingELK/LogstashLogHandler+HTTPFormatting.swift | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Sources/LoggingELK/LogstashLogHandler+HTTPFormatting.swift b/Sources/LoggingELK/LogstashLogHandler+HTTPFormatting.swift index fce31ed..70c82df 100644 --- a/Sources/LoggingELK/LogstashLogHandler+HTTPFormatting.swift +++ b/Sources/LoggingELK/LogstashLogHandler+HTTPFormatting.swift @@ -15,6 +15,7 @@ extension LogstashLogHandler { /// which is then sent to Logstash struct LogstashHTTPBody: Codable { let timestamp: String + let label: String let loglevel: Logger.Level let message: Logger.Message let metadata: Logger.Metadata @@ -68,7 +69,8 @@ extension LogstashLogHandler { metadata: Logger.Metadata) -> Data? { do { let bodyObject = LogstashHTTPBody( - timestamp: timestamp, + timestamp: self.timestamp, + label: self.label, loglevel: level, message: message, metadata: metadata