Click or drag to resize

GelfLayout Class

GELF (Graylog Extended Log Format) is a JSON-based, structured log format for Graylog Log Management.
Inheritance Hierarchy
SystemObject
  NLog.LayoutsLayout
    NLog.LayoutsCompoundLayout
      NLog.LayoutsGelfLayout

Namespace:  NLog.Layouts
Assembly:  NLog.Targets.Network (in NLog.Targets.Network.dll) Version: 6.0.0+be83582280f7a841b0d3c6ae75b4f95aaf07e914
Syntax
public class GelfLayout : CompoundLayout

The GelfLayout type exposes the following members.

Constructors
  NameDescription
Public methodGelfLayout
Initializes a new instance of the GelfLayout class.
Top
Properties
  NameDescription
Public propertyDisableThreadAgnostic
Disables ThreadAgnosticAttribute to capture ScopeContext-properties from active thread context
Public propertyExcludeEmptyProperties
Gets or sets the option to exclude null/empty properties from the log event (as JSON)
Public propertyExcludeProperties
List of property names to exclude when IncludeEventProperties is
Public propertyGelfFacility
Gets or sets whether to activate the legacy Graylog Message Facility-field
Public propertyGelfFields
Gets or sets GELF additional fields
Public propertyGelfFullMessage
Gets or sets the Graylog Message Full-Message-field
Public propertyGelfHostName
Gets or sets Graylog Message Host-field
Public propertyGelfShortMessage
Gets or sets the Graylog Message Short-Message-field
Public propertyIncludeEventProperties
Gets or sets the option to include all properties from the log events
Public propertyIncludeProperties
List of property names to include when IncludeEventProperties is
Public propertyIncludeScopeProperties
Gets or sets whether to include the contents of the ScopeContext properties-dictionary.
Public propertyLayouts
Gets the inner layouts.
(Inherited from CompoundLayout.)
Protected propertyLoggingConfiguration
Gets the logging configuration this target is part of.
(Inherited from Layout.)
Top
Methods
  NameDescription
Protected methodCloseLayout
Closes the layout.
(Overrides CompoundLayoutCloseLayout.)
Protected methodGetFormattedMessage
Renders formatted output using the log event as context.
(Overrides CompoundLayoutGetFormattedMessage(LogEventInfo).)
Protected methodInitializeLayout
Initializes the layout.
(Overrides CompoundLayoutInitializeLayout.)
Public methodPrecalculate
Precalculates the layout for the specified log event and stores the result in per-log event cache. Skips context capture when Layout have [ThreadAgnostic], and only contains 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 CompoundLayoutRenderFormattedMessage(LogEventInfo, StringBuilder).)
Protected methodResolveServiceT
Resolve from DI ServiceRepository
(Inherited from Layout.)
Public methodToString
Returns a string that represents the current object.
(Inherited from CompoundLayout.)
Top
Remarks
Examples

{ "version": "1.1", "host": "example.org", "short_message": "A short message that helps you identify what is going on", "full_message": "Backtrace here\n\nmore stuff", "timestamp": 1385053862.3072, "level": 1, "_user_id": 9001, "_some_info": "foo", "_some_env_var": "bar" }

See Also