Click or drag to resize
JsonLayout Class
A specialized layout that renders JSON-formatted events.
Inheritance Hierarchy

Namespace: NLog.Layouts
Assembly: NLog (in NLog.dll) Version: 4.3.0
Syntax
public class JsonLayout : Layout

The JsonLayout type exposes the following members.

Constructors
  NameDescription
Public methodJsonLayout
Initializes a new instance of the JsonLayout class.
Top
Properties
  NameDescription
Public propertyAttributes
Gets the array of attributes' configurations.
Protected propertyLoggingConfiguration
Gets the logging configuration this target is part of.
(Inherited from Layout.)
Public propertySuppressSpaces
Gets or sets the option to suppress the extra spaces in the output json
Top
Methods
  NameDescription
Protected methodCloseLayout
Closes the layout.
(Inherited from Layout.)
Protected methodGetFormattedMessage
Formats the log event as a JSON document for writing.
(Overrides LayoutGetFormattedMessage(LogEventInfo).)
Protected methodInitializeLayout
Initializes the layout.
(Inherited from Layout.)
Public methodPrecalculate
Precalculates the layout for the specified log event and stores the result in per-log event cache. Only if the layout doesn't have [ThreadAgnostic] and doens't contain layouts with [ThreadAgnostic].
(Inherited from Layout.)
Public methodRender
Renders the event info in layout.
(Inherited from Layout.)
Top
See Also