Click or drag to resize

Log4JXmlEventLayout Class

A specialized layout that renders Log4j-compatible XML events.
Inheritance Hierarchy
SystemObject
  NLog.LayoutsLayout
    NLog.LayoutsCompoundLayout
      NLog.LayoutsLog4JXmlEventLayout

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

The Log4JXmlEventLayout type exposes the following members.

Constructors
  NameDescription
Public methodLog4JXmlEventLayout
Initializes a new instance of the Log4JXmlEventLayout class
Top
Properties
  NameDescription
Public propertyAppInfo
Gets or sets the log4j:event log4japp-xml-element. By default it's the friendly name of the current AppDomain.
Public propertyFormattedMessage
Gets or sets the log4j:event message-xml-element. Default: ${message}
Public propertyIncludeCallSite
Gets or sets a value indicating whether to include call site (class and method name) in the information sent over the network.
Public propertyIncludeEventProperties
Gets or sets the option to include all properties from the log events
Public propertyIncludeNdc
Gets or sets whether to include log4j:NDC in output from ScopeContext nested context.
Public propertyIncludeScopeNested
Gets or sets whether to include log4j:NDC in output from ScopeContext nested context.
Public propertyIncludeScopeProperties
Gets or sets whether to include the contents of the ScopeContext properties-dictionary.
Public propertyIncludeSourceInfo
Gets or sets a value indicating whether to include source info (file name and line number) in the information sent over the network.
Public propertyLayouts
Gets the inner layouts.
(Inherited from CompoundLayout.)
Public propertyLoggerName
Gets or sets the log4j:event logger-xml-attribute. Default: ${logger}
Protected propertyLoggingConfiguration
Gets the logging configuration this target is part of.
(Inherited from Layout.)
Public propertyNdcItemSeparator
Gets or sets the stack separator for log4j:NDC in output from ScopeContext nested context.
Public propertyParameters
Gets the collection of parameters. Each parameter contains a mapping between NLog layout and a named parameter.
Public propertyScopeNestedSeparator
Gets or sets the stack separator for log4j:NDC in output from ScopeContext nested context.
Public propertyWriteThrowableCData
Gets or sets whether the log4j:throwable xml-element should be written as CDATA
Top
Methods
  NameDescription
Protected methodCloseLayout
Closes the layout.
(Inherited from CompoundLayout.)
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
See Also