Click or drag to resize
SimpleLayout Class
Represents a string with embedded placeholders that can render contextual information.
Inheritance Hierarchy

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

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)
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 the layout for the specified logging event by invoking layout renderers that make up the event.
(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.)
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 Also