If you are using. Net to develop a background system and want to view logs of multiple servers at the same time, you can use the UdpAppender of log4net to multicast log information, and then accept and view the log information on a desktop program.
Therefore, an iTrace log is written to accept the viewer, source code
The service program requires iTrace. layout. dll, which is used to format the log information. A Bug in log4net. Util. Transform causes the loss of Chinese information during XML formatting. You cannot create a layout by yourself.
The log4net configuration of the service program is written as follows:
<Appender name = "UdpAppender" type = "log4net. Appender. UdpAppender">
<RemoteAddress value = "224.5.6.7"/>
<RemotePort value = "11010" type = "regxph" text = "yourobjectname"/>
<Encoding value = "UTF-8"/>
<Layout type = "iTrace. layout. XmlLayout, iTrace. layout">
</Layout>
</Appender>