Layout NLog properties as JSON?
问题 I am trying to figure out how to log all the properties in a LogEventInfo object to a JSON-formatted string. Per the issue on github, I tried to do something like this: <target xsi:type="ColoredConsole" name="coloredConsole"> <layout xsi:type="JsonLayout"> <attribute name="timestamp" layout="${longdate}"/> <attribute name="level" layout="${level:uppercase=true}"/> <attribute name="exception" layout="${onexception:${exception:format=tostring}}" /> <attribute name="properties" encode="false">