10000 SyslogLayout · NLog/NLog Wiki · GitHub
[go: up one dir, main page]

Skip to content
Rolf Kristensen edited this page Jul 3, 2025 · 4 revisions

A specialized layout that renders to Syslog Server Format.

Platforms Supported: All - Requires nuget-package NLog.Targets.Network

<target name="syslogFile" xsi:type="File" fileName="syslog-file.txt" >
      <layout xsi:type="SyslogLayout" includeEventProperties="Boolean" excludeProperties="Comma-separated list (string)">
            <Rfc3164>false</Rfc3164>
            <Rfc5424>true</Rfc5424>
            <StructuredDataParam name="String" layout="Layout" /><!-- repeated -->
       </layout>
</target>

Layout Options

  • Rfc3164 - Rfc3164 as Syslog Format. Default = true.

  • Rfc5424 - Rfc5424 as Syslog Format. Default = false.

  • SyslogHostName - Hostname of the sender machine. Default = ${hostname}

  • SyslogAppName - Name of the device / application / process sending the Syslog-message. Default = ${processname}

  • SyslogProcessId - Process Id or Process Name or Logger Name. Default = ${processid}

  • SyslogMessage - Syslog Message Payload. Default = ${message}${onexception:|}${exception:format=shortType,message}.

  • SyslogMessageId - EventId to recognize the Syslog Message Type.

  • SyslogLevel - Syslog Level Mapping.

  • SyslogFacility - Syslog Device Facility. Default = User

  • SyslogTimestamp - Syslog DateTime Format when Rfc5424. Default = ${date:format=o}

  • StructuredDataId - Prefix for StructuredData when Rfc5424. Default = meta

  • IncludeEventProperties - Include all properties from the log events when Rfc5424. Default = true.

  • StructuredDataParam

    • name - Structured property-name when Rfc5424
    • layout - Structured property-value layout
Clone this wiki locally
0