ASP. NET core Source fragrance: Logging Components

Source: Internet
Author: User

Brief introduction:

As the base component, the log component is used by other components and middleware, and it provides a unified programming model that does not need to know where the log is ultimately recorded, just call it.

The use of the method is simple, through the dependency injection Ilogfactory (Createlogger method) or Ilogger<t> object, get a ILogger object, Different levels of logging are then recorded through various extension methods of the ILogger, which are called the log method.

SOURCE Analysis:

Summarize:

The log component is actually the application of the factory pattern, but it has been improved, and Loggerfactory returns a logger object each time, and the Logger object contains a collection of all the ILogger objects that really want to work, forming an appearance pattern.

Follow but do not rigidly adhere to the design pattern, flexible and changeable techniques, it is worth learning!

Related articles:

    • asp: Starting from Hosting

    • ASP. NET core Source fragrance: Configuration Components

    • ASP. NET core Source fragrance: Options Components

Original address: http://www.cnblogs.com/shiliyuanma/p/6706543.html

asp: Logging components (RPM)

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.