Click or drag to resize

Layout Class

Abstract interface that layouts must implement.
Inheritance Hierarchy
SystemObject
  NLog.LayoutsLayout
    More...

Namespace:  NLog.Layouts
Assembly:  NLog (in NLog.dll) Version: 6.0.0+cfb73701cda54e2410b006f649f072e90daef707
Syntax
public abstract class Layout

The Layout type exposes the following members.

Constructors
  NameDescription
Protected methodLayout
Initializes a new instance of the Layout class
Top
Properties
  NameDescription
Protected propertyLoggingConfiguration
Gets the logging configuration this target is part of.
Top
Methods
  NameDescription
Protected methodCloseLayout
Closes the layout.
Public methodStatic memberFromLiteral
Create a SimpleLayout containing literal value
Public methodStatic memberFromMethod
Create a SimpleLayout from a lambda method.
Public methodStatic memberFromString(String)
Parses the specified string as LayoutRenderer-expression into a SimpleLayout.
Public methodStatic memberFromString(String, ConfigurationItemFactory)
Parses the specified string as LayoutRenderer-expression into a SimpleLayout.
Public methodStatic memberFromString(String, Boolean)
Parses the specified string as LayoutRenderer-expression into a SimpleLayout.
Protected methodGetFormattedMessage
Renders formatted output using the log event as context.
Protected methodInitializeLayout
Initializes the layout.
Public methodPrecalculate
Precalculates the layout for the specified log event and stores the result in per-log event cache. Skips context capture when Layout have [ThreadAgnostic], and only contains layouts with [ThreadAgnostic].
Public methodRender(LogEventInfo)
Renders formatted output using the log event as context.
Public methodRender(LogEventInfo, StringBuilder)
Optimized version of Render(LogEventInfo) that works best when override of RenderFormattedMessage(LogEventInfo, StringBuilder) is available.
Protected methodRenderFormattedMessage
Renders formatted output using the log event as context.
Protected methodResolveServiceT
Resolve from DI ServiceRepository
Top
Operators
  NameDescription
Public operatorStatic member(String to Layout)
Implicitly converts the specified string as LayoutRenderer-expression into a Layout.
Top
Fields
  NameDescription
Public fieldStatic memberEmpty
Default Layout-value that renders string.Empty
Top
See Also
Inheritance Hierarchy