Ads by Lake Quincy Media

Wiki Navigation

 
Gibraltar - Learn about the best analysis tool for NLog

CsvLayout

NLog documentation is a Wiki, which allows registered users to edit its content.
If you want to contribute, please create a user account and contact Jarek to get edit access.

A specialized layout that renders CSV-formatted events. 

Supported in

Configuration Syntax

<targets>
  <target>
    <layout xsi:type="CsvLayout">
      <!-- Layout Options -->
      <layout xsi:type="layoutType">Layout</layout>
      <footer xsi:type="layoutType">Layout</footer>
      <header xsi:type="layoutType">Layout</header>

      <!-- CSV Options -->
      <quoting>Enum</quoting>
      <quoteChar>String</quoteChar>
      <withHeader>Boolean</withHeader>
      <customColumnDelimiter>String</customColumnDelimiter>
      <delimiter>Enum</delimiter>
      <column layout="Layoutname="String"/> <!-- repeated -->

    </layout>
  </target>
</targets>
Read more about using the Configuration File.

Parameters

  • Layout Options
  • layout - Body layout (can be repeated multiple times).Layout
  • footer - Footer layout.Layout
  • header - Header layout.Layout
  • CSV Options
  • quoting - Quoting mode. Default: Auto
    Possible values:
    • All - Quote all column.
    • Auto - Quote only whose values contain the quote symbol or the separator.
    • Nothing - Quote nothing.
  • quoteChar - Quote Character. Default: "
  • withHeader - Indicates whether CVS should include header.Boolean
  • customColumnDelimiter - Custom column delimiter value (valid when ColumnDelimiter is set to 'Custom').
  • delimiter - Column delimiter. Default: Auto
    Possible values:
    • Auto - Automatically detect from regional settings.
    • Comma - Comma (ASCII 44).
    • Custom - Custom string, specified by the CustomDelimiter.
    • Pipe - Pipe character (ASCII 124).
    • Semicolon - Semicolon (ASCII 59).
    • Space - Space character (ASCII 32).
    • Tab - Tab character (ASCII 9).
  • columns - The array of parameters to be passed.Collection
    Each collection item is represented by <column /> element with the following attributes:
Ads by Lake Quincy Media