UdpAppender

The UdpAppender sends log events over the network using the UDP protocol. It is typically used to forward log messages to remote logging systems over a network.

The following example shows how to configure the UdpAppender to send events to a remoteAddress on the specified remotePort.

<appender name="UdpAppender" type="log4net.Appender.UdpAppender">
  <localPort value="8080" />
  <remoteAddress value="224.0.0.1" />
  <remotePort value="8080" />
  <layout type="log4net.Layout.PatternLayout, log4net">
    <conversionPattern value="%-5level %logger - %message%newline" />
  </layout>
</appender>

An event that does not fit one datagram is truncated and marked with …​[truncated] rather than dropped: the socket rejects a payload above MaxDatagramSize (default 65507, the maximum UDP payload of an IPv4 packet), and that used to cost the whole event. Lower MaxDatagramSize, down to 512, to match a receiver that accepts less. It cannot be raised: an IPv6 packet would carry 20 bytes more, which is not worth a second limit.