Use log4net multicast to track multi-server system logs

Source: Internet
Author: User
Tags log4net

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>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.