A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/NLog/NLog/wiki/Log4JXml-Target below:

Log4JXml Target · NLog/NLog Wiki · GitHub

Sends log messages to the remote instance of Log4J XML Viewer applications (Like Chainsaw).

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

Introduced with NLog 6.0 where Chainsaw-Target and NLogViewer-Target was merged together into this.

This target inherits from the Network Target, and so it has also all the properties of the Network Target available. Using the Log4JXmlEventLayout to produce Log4J XML output.

<targets>
  <target xsi:type="Log4JXml"
          name="String"
          address="Layout"
          newLine="Boolean"
          onOverflow="Enum"
          maxMessageSize="Integer"
          encoding="Encoding"
          connectionCacheSize="Integer"
          lineEnding="CRLF|LF|CR|None"
          maxConnections="Integer"
          maxQueueSize="Integer"
          keepConnection="Boolean"
          onConnectionOverflow="Enum"
          includeSourceInfo="Boolean"
          includeCallSite="Boolean"
          appInfo="String"
          ndcItemSeparator="String"
          includeNdc="Boolean">
    <parameter name="String" layout="Layout" /><!-- repeated -->
  </target>
</targets>

Read more about using the Configuration File.

<?xml version="1.0" encoding="utf-8"?>
<nlog throwConfigExceptions="true">

  <targets>
    <target name="log4j" xsi:type="Chainsaw" address="udp://127.0.0.1:5001" />
  </targets>

  <rules>
    <logger name="*" minlevel="Trace" writeTo="log4j" />
  </rules>
</nlog>

Available Log4J-XML viewers (See also LogViewer Tools)

Notice that most Log4J-XML viewers will drop messages and stall when NLog sends messages at full speed. One can consider to throttle NLog like this:

<?xml version="1.0" encoding="utf-8"?>
<nlog throwConfigExceptions="true">

  <targets>
    <target name="throttle_log4j" type="AsyncWrapper" timeToSleepBetweenBatches="100" batchSize="1" overflowAction="Block">
      <target name="log4j" type="Log4JXml" address="tcp://127.0.0.1:5001" newline="true" />
    </target>
  </targets>

  <rules>
    <logger name="*" minlevel="Trace" writeTo="throttle_log4j" />
  </rules>
</nlog>

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4