log4net:
...
<appender name="UdpAppender" type="log4net.Appender.UdpAppender">
<remoteAddress value="localhost" />
<remotePort value="5561" />
<layout type="log4net.Layout.SerializedLayout, log4net.Ext.Json">
</layout>
</appender>
...
Hi, make your log4net log to a local UDP port where nxlog is listening. To simplify parsing you may add JSON formatting with my project
log4net.Ext.Json. Like that, you'll skip the unnecessary file logging and relieve the application from disk IO. Running nxlog process with a higher priority than the logging app will ensure it has the upper hand on UDP and hence prevent losing logs even under heavy stress.
nxlog:
...
<Extension json>
# We expect JSON on the UDP input, this module provides parse_json()
Module xm_json
</Extension>
<Input udpjson>
# Listen on local UDP port for JSON events
Module im_udp
Host localhost
Port 5561
</Input>
...