A specialized layout that renders to JSON-Array. See also JsonLayout
Platforms Supported: All
Introduced with NLog 5.0
<target name="jsonFile" xsi:type="File" fileName="log-file.json" > <layout xsi:type="JsonArrayLayout"> <item type='SimpleLayout' text='${date:format=o}' /> <item type='SimpleLayout' text='${level}' /> <item type='SimpleLayout' text='${message}' /> </layout> </target>
Example output:
[ "2010-01-01T12:34:56Z", "Info", "hello world" ]
Layout
SimpleLayout
JsonLayout
false
[]
true
There was an error while loading. Please reload this page.