Composer-php-fig psr-3 Log interface How to understand? Monolog, what's the point?

Source: Internet
Author: User
See this PSR Chinese version, Https://github.com/PizzaLiu/PHP-FIG

or English original: http://www.php-fig.org/

Where prs-0,psr-1,psr-2,psr-4 are better understood,

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

And look here, https://packagist.org/explore/.

Among them "Popular Packages" The first is the PSR log class,

The second is monolog this log class, why so Dick?
Https://packagist.org/packages/monolog/monolog

If it's used, is it monolog PSR-3?

Reply content:

See this PSR Chinese version, Https://github.com/PizzaLiu/PHP-FIG

or English original: http://www.php-fig.org/

Where prs-0,psr-1,psr-2,psr-4 are better understood,

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

And look here, https://packagist.org/explore/.

Among them "Popular Packages" The first is the PSR log class,

The second is monolog this log class, why so Dick?
Https://packagist.org/packages/monolog/monolog

If it's used, is it monolog PSR-3?

Monolog is an implementation of a log class that conforms to the PSR-3 standard

PSR-3 requires inheritance loggerinterface is mainly in the unified various components in the Logging module interface Intent, ideally all third-party modules involved in "logging" all through the acceptance of a loggerinterface instance and then by the interface to record the log, Without having to do a set of each module "If you want to remember files, configure XXX, remember DB configuration yyy, log files regularly deleted with the zzz" things like

So the last word of the title of the Lord may be better than the other, requiring that the PSR-3 specification log can be used as an instance of the Monolog library as a concrete implementation
With Monolog and not through loggerinterface excuses, can't reach PSR-3 's original intention

However, this is based on the "Write Open source module," "Write a third party component" as the premise (the owner can check the full name of Fig:)) in the actual business project, it does not matter how PSR-3

  • 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.