-
Notifications
You must be signed in to change notification settings - Fork 1.4k
GelfLayout
A specialized layout that renders to Graylog Extended Log Format (GELF) which produces JSON output.
Platforms Supported: All - Requires nuget-package NLog.Targets.Network
<target name="jsonFile" xsi:type="File" fileName="gelf-file.json" >
<layout xsi:type="GelfLayout" includeEventProperties="Boolean" excludeProperties="Comma-separated list (string)">
<GelfField name="threadid" layout="${threadid}" />
</layout>
</target>
-
GelfHostName - Graylog Message Host-field. Default =
${hostname}
-
GelfShortMessage - Graylog Message Short-Message-field (Truncates when longer than 250 chars). Default =
${message}
-
GelfFullMessage - Graylog Message Full-Message-field. Default =
${message}
-
GelfFacility - Legacy Graylog Message Facility-field. Default =
null
-
IncludeEventProperties - Include all properties from the log events. Default =
true
. -
IncludeScopeProperties - Include all scope-properties from the ScopeContext. Default =
false
. -
ExcludeEmptyProperties - Exclude null/empty properties. Default =
false
. -
ExcludeProperties - Comma separated string with names which properties to exclude.
-
IncludeProperties - Comma separated string with names which properties to explicitly include.
-
GelfField
- name - Required. The name of the JSON-key
- layout - The layout for the JSON-value (Can be a nested JsonLayout)
- 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