spiral / framework

High-Performance PHP Framework
https://spiral.dev
MIT License
1.82k stars 89 forks source link

[Monolog] Expose LoggerChannel attribute #1102

Closed roxblnfk closed 7 months ago

roxblnfk commented 7 months ago
Q A
Bugfix?
Breaks BC?
New feature? ✔️
Docs PR https://github.com/spiral/docs/pull/699

The Pull Request adds the ability to specify the logger channel in the code using a parameter attribute:

function (#[LoggerChannel('foo')] LoggerInterface $logger) {
    // Logger with channel `foo` will be injected
    // ...
}