Treat sub-properties more like properties
TysonMN opened this issue · 3 comments
Consider the log event represented by the following (pretty printed) JSON.
{
"@t": "2020-10-09T11:45:23.8870116-05:00",
"@mt": "MyMessage",
"@m": "MyMessage",
"@i": "1f5acfc5",
"@x": "System.ArgumentNullException: Value cannot be null. (Parameter 'argName')",
"ExceptionDetail": {
"Type": "System.ArgumentNullException",
"HResult": -2147467261,
"Message": "Value cannot be null. (Parameter 'argName')",
"Source": null,
"ParamName": "argName"
}
}
I created it using Serilog.Exceptions and this code.
var e = new ArgumentNullException("argName");
var logger = new LoggerConfiguration()
.Enrich.WithExceptionDetails()
.WriteTo.Seq("http://localhost:5341")
.CreateLogger();
logger.Information(e, "MyMessage");
In Seq, here is what that event looks like.
Eventually I realized that I could interact with that value and expand the JSON into a pretty-printed form.
Then I can interact with each sub-property. However, the available options are not the same as a top-level property. Also, I dislike still seeing the characters that are define the JSON syntax (namely curly braces at the beginning and end, colons between keys and values, single quotes arounds values, and commas after values).
I was hoping that Seq would display the data more like this...
...where all the checks have the same options, all the Xs have the same options, and the triangle next to ExceptionDetail
toggles between the view in that image and all those sub-properties inlined to the right of ExceptionDetail
(and the triangle points to the right when the sub-properties are inlined).
Does changing the display and treatment of sub-properties as I have described and shown seem like a reasonable improvement?
Hi Tyson, thanks for the feedback! We're working towards the general direction you've described.
It's not precisely clear where we'll end up, just yet, but some of these points - especially providing more find/exclude/plot options on nested properties - are goals we wrote the new structured data viewer with the aim of supporting.
We'll loop back to this in our next round of triage/planning and update you here 👍
Sorry Tyson, I've just realized this should be in datalust/seq-tickets rather than the Serilog repo here; I'll create a new issue and link this one.
Oh, sorry about that. Thanks for getting it to the right spot.