Skip to content

Commit 6840301

Browse files
committed
Updated the default serialization depth to 10
This should help retain error information as we had some clients run into issues where parts of the stack trace were missing.
1 parent 0bb2bad commit 6840301

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

Source/Shared/Serializer/DefaultJsonSerializer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public DefaultJsonSerializer() {
2626
_serializerSettings.Converters.Add(new RequestInfoConverter());
2727
}
2828

29-
public virtual string Serialize(object model, string[] exclusions = null, int maxDepth = 5, bool continueOnSerializationError = true) {
29+
public virtual string Serialize(object model, string[] exclusions = null, int maxDepth = 10, bool continueOnSerializationError = true) {
3030
if (model == null)
3131
return null;
3232

Source/Shared/Serializer/IJsonSerializer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
namespace Exceptionless {
44
public interface IJsonSerializer {
5-
string Serialize(object model, string[] exclusions = null, int maxDepth = 5, bool continueOnSerializationError = true);
5+
string Serialize(object model, string[] exclusions = null, int maxDepth = 10, bool continueOnSerializationError = true);
66
object Deserialize(string json, Type type);
77
}
88
}

Source/Tests/Serializer/SerializerTests.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ public void WillSerializeDeepExceptionWithStackInformation() {
150150
var ev = new Event { Data = { [Event.KnownDataKeys.Error] = error } };
151151

152152
IJsonSerializer serializer = GetSerializer();
153-
string json = serializer.Serialize(ev, maxDepth: 10);
153+
string json = serializer.Serialize(ev);
154154

155155
Assert.Contains(String.Format("\"line_number\":{0}", error.Inner.Inner.StackTrace.Single().LineNumber), json);
156156
}

0 commit comments

Comments
 (0)