-
Notifications
You must be signed in to change notification settings - Fork 1.4k
SyslogLayout
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>
-
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
- Troubleshooting Guide - See available NLog Targets and Layouts: https://nlog-project.org/config
- Getting started
- How to use structured logging
- Troubleshooting
- FAQ
- Articles about NLog
-
All targets, layouts and layout renderers
Popular: - Using NLog with NLog.config
- Using NLog with appsettings.json