I would like to have JsonLayout in web service target so that I can use includeAllProperties="true"
<target xsi:type="WebService"
name="ws"
url="http://localhost:59802/api/hello/indexer"
protocol="JsonPost"
encoding="UTF-8">
<parameter name="root">
<layout xsi:type="JsonLayout" includeAllProperties="true">
<attribute name="Level" layout="${level}" />
<attribute name="Timestamp" layout="${longdate}" />
<attribute name="Message" layout="${message}" />
</layout>
</parameter>
</target>
This creates the following output
{ "root" : { "level" : "info", "message" : "xxx", "event1" : "aaa" } }
Actually, I would like to have as following
{ "level" : "info", "message" : "xxx", "event1" : "aaa" }
Does Nlog support to directly use JsonLayout instead of wrapping in <parameter />? Or there any ways to hack around and achieve this output? file and console support it but web service target does not seem too. Any help is greatly appreciated.