Click or drag to resize

CsvLayout Class

A specialized layout that renders CSV-formatted events.
Inheritance Hierarchy
SystemObject
  NLog.LayoutsLayout
    NLog.LayoutsLayoutWithHeaderAndFooter
      NLog.LayoutsCsvLayout

Namespace:  NLog.Layouts
Assembly:  NLog (in NLog.dll) Version: 5.3.1+cf6675da40ccfd4c8c526a3b2bdbeed3442910a1
Syntax
public class CsvLayout : LayoutWithHeaderAndFooter

The CsvLayout type exposes the following members.

Constructors
  NameDescription
Public methodCsvLayout
Initializes a new instance of the CsvLayout class.
Top
Properties
  NameDescription
Public propertyColumns
Gets the array of parameters to be passed.
Public propertyCustomColumnDelimiter
Gets or sets the custom column delimiter value (valid when Delimiter is set to Custom).
Public propertyDelimiter
Gets or sets the column delimiter.
Public propertyFooter
Gets or sets the footer layout.
(Inherited from LayoutWithHeaderAndFooter.)
Public propertyHeader
Gets or sets the header layout.
(Inherited from LayoutWithHeaderAndFooter.)
Public propertyLayout
Gets or sets the body layout (can be repeated multiple times).
(Inherited from LayoutWithHeaderAndFooter.)
Protected propertyLoggingConfiguration
Gets the logging configuration this target is part of.
(Inherited from Layout.)
Public propertyQuoteChar
Gets or sets the quote Character.
Public propertyQuoting
Gets or sets the quoting mode.
Public propertyWithHeader
Gets or sets a value indicating whether CVS should include header.
Top
Methods
  NameDescription
Protected methodCloseLayout
Closes the layout.
(Overrides LayoutCloseLayout.)
Protected methodGetFormattedMessage
Renders formatted output using the log event as context.
(Overrides LayoutWithHeaderAndFooterGetFormattedMessage(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].
(Inherited from Layout.)
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 LayoutWithHeaderAndFooterRenderFormattedMessage(LogEventInfo, StringBuilder).)
Protected methodResolveServiceT
Resolve from DI ServiceRepository
(Inherited from Layout.)
Public methodToString
Returns a string that represents the current object.
(Overrides ObjectToString.)
Top
Remarks

If Header is set, then the header generation with column names will be disabled.

See NLog Wiki
See Also