<PackageReference Include="NLog" Version="6.0.7" />

NLog.Layouts.JsonLayout

public class JsonLayout : Layout
A specialized layout that renders JSON-formatted events.
public IList<JsonAttribute> Attributes { get; }

Gets the array of attributes' configurations.

public bool EscapeForwardSlash { get; set; }

Should forward slashes be escaped? If true, / will be converted to \/

public bool ExcludeEmptyProperties { get; set; }

Gets or sets the option to exclude null/empty properties from the log event (as JSON)

public ISet<string> ExcludeProperties { get; set; }

List of property names to exclude when IncludeAllProperties is true

public bool IncludeAllProperties { get; set; }

Obsolete and replaced by IncludeEventProperties with NLog v5. Gets or sets the option to include all properties from the log event (as JSON)

public bool IncludeEventProperties { get; set; }

Gets or sets the option to include all properties from the log event (as JSON)

public bool IncludeGdc { get; set; }

Gets or sets a value indicating whether to include contents of the GlobalDiagnosticsContext dictionary.

public bool IncludeMdc { get; set; }

Obsolete and replaced by IncludeScopeProperties with NLog v5. Gets or sets a value indicating whether to include contents of the MappedDiagnosticsContext dictionary.

public bool IncludeMdlc { get; set; }

Obsolete and replaced by IncludeScopeProperties with NLog v5. Gets or sets a value indicating whether to include contents of the MappedDiagnosticsLogicalContext dictionary.

public bool IncludeScopeProperties { get; set; }

Gets or sets whether to include the contents of the ScopeContext dictionary.

public bool IndentJson { get; set; }

Auto indent and create new lines

public int MaxRecursionLimit { get; set; }

How far should the JSON serializer follow object references before backing off

public bool RenderEmptyObject { get; set; }

Gets or sets the option to render the empty object value {}

public bool SuppressSpaces { get; set; }

Gets or sets the option to suppress the extra spaces in the output json.

public JsonLayout()

Initializes a new instance of the JsonLayout class.