serilog-contrib / Serilog.Sinks.Logz.Io

Apache License 2.0
15 stars 11 forks source link

newtonsoft json self-referencing detected error #11

Closed arisliang closed 3 years ago

arisliang commented 3 years ago

We keep encounter below error, it seems related to newtonsoft json serialization handling on self-referencing.

So it's unable to send out the log to logzio, is there anyway we can configure the self-referencing check off, so it can be sent out?

Exception while emitting periodic batch from Serilog.Sinks.Logz.Io.LogzioSink: Newtonsoft.Json.JsonSerializationException: Self referencing loop detected with type 'Flurl.Http.HttpCall'. Path 'exception.Call.Request.Properties'. at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.CheckForCircularReference(JsonWriter writer, Object value, JsonProperty property, JsonContract contract, JsonContainerContract containerContract, JsonProperty containerProperty) at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeDictionary(JsonWriter writer, IDictionary values, JsonDictionaryContract contract, JsonProperty member, JsonContainerContract collectionContract, JsonProperty containerProperty) at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeObject(JsonWriter writer, Object value, JsonObjectContract contract, JsonProperty member, JsonContainerContract collectionContract, JsonProperty containerProperty) at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeObject(JsonWriter writer, Object value, JsonObjectContract contract, JsonProperty member, JsonContainerContract collectionContract, JsonProperty containerProperty) at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeObject(JsonWriter writer, Object value, JsonObjectContract contract, JsonProperty member, JsonContainerContract collectionContract, JsonProperty containerProperty) at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.SerializeDictionary(JsonWriter writer, IDictionary values, JsonDictionaryContract contract, JsonProperty member, JsonContainerContract collectionContract, JsonProperty containerProperty) at Newtonsoft.Json.Serialization.JsonSerializerInternalWriter.Serialize(JsonWriter jsonWriter, Object value, Type objectType) at Newtonsoft.Json.JsonSerializer.SerializeInternal(JsonWriter jsonWriter, Object value, Type objectType) at Newtonsoft.Json.JsonConvert.SerializeObjectInternal(Object value, Type type, JsonSerializer jsonSerializer) at Serilog.Sinks.Logz.Io.LogzioSink.FormatLogEvent(LogEvent loggingEvent) at System.Linq.Enumerable.SelectEnumerableIterator2.ToArray() at System.Linq.Enumerable.ToArray[TSource](IEnumerable1 source) at Serilog.Sinks.Logz.Io.LogzioSink.FormatPayload(IEnumerable1 events) at Serilog.Sinks.Logz.Io.LogzioSink.EmitBatchAsync(IEnumerable1 events) at Serilog.Sinks.PeriodicBatching.PeriodicBatchingSink.OnTick()

mantasaudickas commented 3 years ago

Published version 2.2.3