Log4net logs uploaded to Graylog monitoring

Source: Internet
Author: User
Tags graylog log4net

Graylog is a log monitoring plugin for Java. The storage is MongoDB, the efficiency is very high. However, the documentation is too small, and installation and configuration are not easy.

Official website: http://www.graylog.org/

In Graylog, configure a UDP monitor mode, such as:

Then, under Log4net, the configuration is changed as follows:

<?xml version="1.0"?><configuration> <configSections> <section name="log4net"Type="log4net. Config.log4netconfigurationsectionhandler, Log4net"/> </configSections> <log4net> <appender name="Udpappender"Type="log4net. Appender.udpappender"> <param name="Encoding"Value="Utf-8"/> <remoteaddress value=""/> <remoteport value="5514"/> <layout type="log4net. Layout.patternlayout"Value="&lt;1&gt;1%UTCDATE{YYYY-MM-DDTHH:MM:SS:FFZ} [%PROPERTY{NDC}]%logger Thread=[%thread] SOA%thread%level -%message%newline"/> </appender> <root> <appender-ref ref="Udpappender"/> <appender-ref ref="logfilebydate"/> </root> </log4net></configuration>

The configuration file is primarily paired with the IP address and port.

After an exception occurs, in the Graylog, you will see the log display:

Log4net logs uploaded to Graylog monitoring

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.