From 822d56d9768ba759d315f8145b8cf92105605d8e Mon Sep 17 00:00:00 2001 From: Matt Hosking Date: Tue, 31 Mar 2020 20:29:00 +1100 Subject: [PATCH] fix: use no indentation for json logging Enabling indentation for json in logs by setting default json serializer settings causes those logs to be split over multiple entries due to the new line characters. To avoid this the serializer formatting should always be set to override as "None". --- source/log4net-loggly/LogglyFormatter.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/source/log4net-loggly/LogglyFormatter.cs b/source/log4net-loggly/LogglyFormatter.cs index 3ad3c6e..ec0196c 100644 --- a/source/log4net-loggly/LogglyFormatter.cs +++ b/source/log4net-loggly/LogglyFormatter.cs @@ -83,6 +83,7 @@ private static string ToJsonString(JObject loggingInfo) loggingInfo, new JsonSerializerSettings { + Formatting = Formatting.None, ReferenceLoopHandling = ReferenceLoopHandling.Ignore, }); }