Click or drag to resize

SimpleLayout Class

Represents a string with embedded placeholders that can render contextual information.
Inheritance Hierarchy
SystemObject
  NLog.LayoutsLayout
    NLog.LayoutsSimpleLayout

Namespace:  NLog.Layouts
Assembly:  NLog (in NLog.dll) Version: 5.3.1+cf6675da40ccfd4c8c526a3b2bdbeed3442910a1
Syntax
public class SimpleLayout : Layout, 
	IUsesStackTrace

The SimpleLayout type exposes the following members.

Constructors
  NameDescription
Public methodSimpleLayout
Initializes a new instance of the SimpleLayout class.
Public methodSimpleLayout(String)
Initializes a new instance of the SimpleLayout class.
Public methodSimpleLayout(String, ConfigurationItemFactory)
Initializes a new instance of the SimpleLayout class.
Top
Properties
  NameDescription
Public propertyFixedText
Get the fixed text. Only set when IsFixedText is true
Public propertyIsFixedText
Is the message fixed? (no Layout renderers used)
Public propertyLayoutRenderers
Gets a collection of LayoutRenderer objects that make up this layout.
Protected propertyLoggingConfiguration
Gets the logging configuration this target is part of.
(Inherited from Layout.)
Public propertyOriginalText
Original text before compile to Layout renderes
Public propertyRenderers
Gets a collection of LayoutRenderer objects that make up this layout.
Public propertyStackTraceUsage
Gets the level of stack trace information required for rendering.
Public propertyText
Gets or sets the layout text.
Top
Methods
  NameDescription
Protected methodCloseLayout
Closes the layout.
(Inherited from Layout.)
Public methodStatic memberEscape
Escapes the passed text so that it can be used literally in all places where layout is normally expected without being treated as layout.
Public methodStatic memberEvaluate(String)
Evaluates the specified text by expanding all layout renderers in new LogEventInfo context.
Public methodStatic memberEvaluate(String, LogEventInfo)
Evaluates the specified text by expanding all layout renderers.
Protected methodGetFormattedMessage
Renders formatted output using the log event as context.
(Overrides LayoutGetFormattedMessage(LogEventInfo).)
Protected methodInitializeLayout
Initializes the layout.
(Overrides LayoutInitializeLayout.)
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 doesn't contain layouts with [ThreadAgnostic].
(Overrides LayoutPrecalculate(LogEventInfo).)
Public methodRender(LogEventInfo)
Renders formatted output using the log event as context.
(Inherited from Layout.)
Public methodRender(LogEventInfo, StringBuilder)
Optimized version of Render(LogEventInfo) that works best when override of RenderFormattedMessage(LogEventInfo, StringBuilder) is available.
(Inherited from Layout.)
Protected methodRenderFormattedMessage
Renders formatted output using the log event as context.
(Overrides LayoutRenderFormattedMessage(LogEventInfo, StringBuilder).)
Protected methodResolveServiceT
Resolve from DI ServiceRepository
(Inherited from Layout.)
Public methodToString
Returns a string that represents the current object.
(Overrides ObjectToString.)
Top
Operators
Remarks

This layout is not meant to be used explicitly. Instead you can just use a string containing layout renderers everywhere the layout is required.

See NLog Wiki
See Also