Composer-php-figpsr-3 log interface how to understand? What are the advantages of monolog?

Source: Internet
Author: User
Please refer to the Chinese version of this SRS, github. comPizzaLiuPHP-FIG or English original: www.php-fig.org where PRS-0, PSR-1, PSR-2, PSR-4 are better understood, but do not understand, what is the meaning of PSR-3, is said if write log class, it is best to inherit... look at the Chinese version of this HDR, https://github.com/PizzaLiu/PHP-FIG

Or Original ENGLISH: http://www.php-fig.org/

PRS-0, PSR-1, PSR-2, PSR-4 are better understood,

But do not understand, what does PSR-3 mean, is to say if write log class, it is better to inherit that interface or what does it mean?
Http://www.php-fig.org/psr/psr-3/

And look at the https://packagist.org/explore/ here.

Among them, the "Popular Packages" is the first log class of the SRS,

The second ismonologHow is this log class so embarrassing?
Https://packagist.org/packages/monolog/monolog

IfmonologDon't worry about PSR-3?

Reply content:

Look at the Chinese version of this HDR, https://github.com/PizzaLiu/PHP-FIG

Or Original ENGLISH: http://www.php-fig.org/

PRS-0, PSR-1, PSR-2, PSR-4 are better understood,

But do not understand, what does PSR-3 mean, is to say if write log class, it is better to inherit that interface or what does it mean?
Http://www.php-fig.org/psr/psr-3/

And look at the https://packagist.org/explore/ here.

Among them, the "Popular Packages" is the first log class of the SRS,

The second ismonologHow is this log class so embarrassing?
Https://packagist.org/packages/monolog/monolog

IfmonologDon't worry about PSR-3?

Monolog is an implementation of the log class compliant with PSR-3 standards

PSR-3 requirements inherit the LoggerInterface is mainly in a unified component logging Module Interface intent, ideally, all third-party modules that involve "logging" will accept a LoggerInterface instance and record logs by interface, without each module having to create a set of "If you want to remember files, configure XXX, record db configuration YYY, and regularly Delete log files with ZZZ

Therefore, the last sentence of the subject may be better, requiring that the monolog library instance can be used as the specific implementation of the place where logs are recorded in the PSR-3 Specification
The original intention of PSR-3 could not be reached with monolog without the excuse of using LoggerInterface

But this is to "Write open source module" "Write third-party components" as the premise (subject can look up the full name of FIG :)) in the actual business project, indeed no matter what the PSR-3 will not do

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.