Click or drag to resize

ReplaceLayoutRendererWrapper Class

Replaces a string in the output of another layout with another string.
Inheritance Hierarchy
SystemObject
  NLog.LayoutRenderersLayoutRenderer
    NLog.LayoutRenderers.WrappersWrapperLayoutRendererBase
      NLog.LayoutRenderers.WrappersReplaceLayoutRendererWrapper

Namespace:  NLog.LayoutRenderers.Wrappers
Assembly:  NLog (in NLog.dll) Version: 5.3.4+73d83d3161d31288ca5c554cc50d27b6bed5f28b
Syntax
public sealed class ReplaceLayoutRendererWrapper : WrapperLayoutRendererBase

The ReplaceLayoutRendererWrapper type exposes the following members.

Constructors
  NameDescription
Public methodReplaceLayoutRendererWrapper
Initializes a new instance of the ReplaceLayoutRendererWrapper class
Top
Properties
  NameDescription
Public propertyCompileRegex
Compile the Regex? This can improve the performance, but at the costs of more memory usage. If false, the Regex Cache is used.
Public propertyIgnoreCase
Gets or sets a value indicating whether to ignore case.
Public propertyInner
Gets or sets the wrapped layout. [DefaultParameter] so Inner: is not required if it's the first
(Inherited from WrapperLayoutRendererBase.)
Public propertyRegex
Gets or sets a value indicating whether regular expressions should be used.
Public propertyReplaceGroupName
Gets or sets the group name to replace when using regular expressions. Leave null or empty to replace without using group name.
Public propertyReplaceWith
Gets or sets the replacement string.
Public propertySearchFor
Gets or sets the text to search for.
Public propertyWholeWords
Gets or sets a value indicating whether to search for whole words.
Top
Methods
  NameDescription
Public methodRender
Renders the value of layout renderer in the context of the specified log event.
(Inherited from LayoutRenderer.)
Public methodStatic memberReplaceNamedGroup Obsolete.
A match evaluator for Regular Expression based replacing
Public methodToString
Returns a string that represents the current object.
(Inherited from LayoutRenderer.)
Top
Remarks
Examples
${replace:searchFor=\\n+:replaceWith=-:regex=true:inner=${message}}
See Also