Log4net Series II: Log4net mail Log

Source: Internet
Author: User
Tags log4net

log4net Mail Sending

In the previous article we mainly introduce log4net generated text format, this article mainly configures the mailbox to send. Reference to the project, build we are not described, if not very clear, please look at the article,

The usual, we now add a appender to the config file about mailbox sending:

<!--email send-<appender name="Smtpappender"Type="log4net. Appender.smtpappender"> <authentication value="Basic"/> <!--<to value="mailbox that accepts mail"/> < fromValue="the mailbox that sent the message"/> <username value="the mailbox that sent the message"/> <password value="password to send the message"/> <subject value="XXX Application error log messages"/>--> <to value="[email protected]"/> < fromValue="1***@163.com"/> <username value="1***@163.com"/> <!--for client authorization codes-<password value="***********"/> <subject value="Log Messages"/> <!--<smtphost value="smtp.exmail.qq.com"/>--> <smtphost value="smtp.163.com"/> <lossy value="true"/> <evaluator type="log4net. Core.levelevaluator"> <threshold value="DEBUG"/> </evaluator> <layout type="log4net. Layout.patternlayout"> <conversionpattern value="%newline%n Recording time:%date%n thread Id:[%thread]%n log level:%-5level%n Log Description:%message%newline %n"/> </layout> </appender> <!--mailbox Important logs::: Important logs. -<logger Name="LOGDEBUGSMTP"> <level value="DEBUG"/> <appender-ref ref="Smtpappender"/> </logger>
Warm tip: The configuration of the authorization code here, not the password, about the authorization code how to get, you must be confused, don't worry, I give you to parse
<!--for client authorization code--<password value="*********" />

To obtain the authorization code step:

First step: Enter the authorization page

Part II:

Part III: Send SMS

Then follow the prompts to define your own authorization code ....



log4net Mail Sample Send

Send Results Example: 163 mailbox sent to QQ mailbox







    • Bo Master is the use of reading, reference, quoting, copying, copying and pasting a variety of ways to make their own pure 24k article, please forgive bloggers become a shameless document Porter!
    • Younger brother just entered the blog writing, the text if there is not, welcome to use the board to straighten, hope to help you.

Log4net Series II: Log4net mail Log

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.