A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/NLog/NLog/wiki/MicrosoftConsoleJsonLayout below:

MicrosoftConsoleJsonLayout · NLog/NLog Wiki · GitHub

A custom NLog JsonLayout that renders to JSON to simulate Microsoft Logging AddJsonConsole.

Platforms Supported: All

Introduced with NLog.Extensions.Logging ver. 5.0

<target name="jsonFile" xsi:type="File" fileName="${logFileNamePrefix}.json" >
      <layout xsi:type="MicrosoftConsoleJsonLayout" includeScopes="Boolean">
         <attribute name="extraPropertyName" layout="extraPropertyValue" />
         <state name="extraStateName" layout="extraStateValue" />
      </layout>
</target>

This would write:

{ "Timestamp": "2010-01-01 12:34:56.0000Z", "EventId": 110, "LogLevel": "Debug", "Category": "ConsoleApp.Program", "message": "hello, world", "State": { "location:" "world", "{OriginalFormat}": "hello, {location}" } }

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4