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 ismonolog
How is this log class so embarrassing?
Https://packagist.org/packages/monolog/monolog
Ifmonolog
Don'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 ismonolog
How is this log class so embarrassing?
Https://packagist.org/packages/monolog/monolog
Ifmonolog
Don'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