Complex properties are not rendered
Describe the bug Within the properties sub-heading of a selected log message, complex properties are not displayed. The property name is included in the left column, but the right column does not contain any value. Properties that are scalar are rendered appropriately.
To Reproduce Steps to reproduce the behavior:
- Create a log file with the following text:
{
"@t": "2019-12-10T13:33:23.0970926Z",
"@mt": "An unknown error occurred",
"@l": "Error",
"@x": "Exception stack trace",
"SourceContext": "MySourceContext",
"Scope": [
"FirstScope",
1850562557,
"198441851"
],
"MachineName": "MY-MACHINE",
"EnvironmentUserName": "WORKGROUP\\SYSTEM",
"ExceptionDetail": {
"HResult": -2146233087,
"Message": "Internal Error",
"Source": "System.ServiceModel",
"Action": null,
"Code": {
"IsPredefinedFault": true,
"IsSenderFault": true,
"IsReceiverFault": false,
"Namespace": "http://schemas.xmlsoap.org/soap/envelope/",
"Name": "Client",
"SubCode": null
},
"Reason": {
"Translations": [
{
"XmlLang": "",
"Text": "Internal Error"
}
]
},
"Type": "System.ServiceModel.FaultException"
},
"AssemblyVersion": "2.1.0.1017"
}
{"@t":"2019-12-10T13:33:23.0970926Z","@mt":"An unknown error occurred","@l":"Error","@x":"Exception stack trace","SourceContext":"MySourceContext","Scope":["FirstScope",1850562557,"198441851"],"MachineName":"MY-MACHINE","EnvironmentUserName":"WORKGROUP\\SYSTEM","ExceptionDetail":{"HResult":-2146233087,"Message":"Internal Error","Source":"System.ServiceModel","Action":null,"Code":{"IsPredefinedFault":true,"IsSenderFault":true,"IsReceiverFault":false,"Namespace":"http://schemas.xmlsoap.org/soap/envelope/","Name":"Client","SubCode":null},"Reason":{"Translations":[{"XmlLang":"","Text":"Internal Error"}]},"Type":"System.ServiceModel.FaultException"},"AssemblyVersion":"2.1.0.1017"}
- Open this file with Compact Log Viewer
- Select the (only) log message to expand it
- See that the properties Scope and ExceptionDetail are empty.
Expected behavior The two complex properties should have values displayed in the right column. Since they are complex properties, a JSON rendering would be applicable.
Screenshots
The complex properties are highlighted in yellow. Sensitive data has been scrubbed.
Desktop (please complete the following information):
- OS: Windows 10
- Version: 1803
Hi, I'm in the process of creating Serilog parser for my Log Viewer (https://github.com/philips-software/logviewer) at (https://github.com/Analogy-LogViewer/Analogy.LogViewer.Serilog).
Is this standard log file for Serlilog that I can user as reference?
@LiorBanai Serilog can produce files in many different formats, depending on the developer's configuration settings. The log file I posted is in "compact JSON" format. The log viewer in this repository is specifically designed to handle that format. More information on the Compact format can be found at the formatter's repository.
@bcallaghan-et Thanks! I'll look into it :)
Best as I can tell, there wasn't support for this at all. I've added some extremely basic support (just an array of first-level key value pairs) in #15
I don't want to hijack this thread but I'm not sure how I can message @bcallaghan-et directly..
I just did a small test to see how easy it to parser it. Generic fields of serilog like "@t" are easy. the other I'll match by ui later on. by code I can parse it to the following (plann to have foll Serilog parser later on at https://github.com/Analogy-LogViewer/Analogy.LogViewer.Serilog:

I can just confirm this one =D
Apologies all, I have not been on top of this project as much as I would like to be. Thanks for the feedback & PR I will try & get to this tomorrow :)
Merged in the PR from @chucker that helps with some of this 💪
However I am leaving this issue open for now so that we can get the example JSON file in this issue with arrays & nested objects to work no matter how deep with some better recursion, otherwise I would simply forget 🙈