From a2ed87f7ce446877e3609fd5fb72a508a7b7e344 Mon Sep 17 00:00:00 2001 From: Mira <56395159+TheXorog@users.noreply.github.com> Date: Wed, 23 Aug 2023 04:26:20 +0200 Subject: [PATCH] Update LoggerClient.cs --- LoggerClient.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/LoggerClient.cs b/LoggerClient.cs index fea391c..6b1a463 100644 --- a/LoggerClient.cs +++ b/LoggerClient.cs @@ -231,7 +231,12 @@ public sealed class LoggerClient : ILogger if (currentLog.Exception is not null) try { - Console.WriteLine(JsonConvert.SerializeObject(currentLog.Exception, Formatting.Indented, new JsonSerializerSettings() { NullValueHandling = NullValueHandling.Ignore })); + Console.WriteLine(JsonConvert.SerializeObject(currentLog.Exception, Formatting.Indented, new JsonSerializerSettings() + { + NullValueHandling = NullValueHandling.Ignore, + ReferenceLoopHandling = ReferenceLoopHandling.Ignore, + Error = (serializer, err) => err.ErrorContext.Handled = true + })); } catch (Exception) {