WithMonologChannel but for property since I have multiple channels · Issue #1960 · Seldaek/monolog · GitHub
More Web Proxy on the site http://driver.im/
You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'd like to use WithMonologChannel attribute to define which logger is for which channel but that attribute currently applies only to the whole class. I'd like to have the ability to use WithMonologChannel like this:
class Foo {
publicfunction__construct(
#[WithMonologChannel('foo')]
LoggerInterface$aaaLogger,
#[WithMonologChannel('bar')]
LoggerInterface$bbbLogger
)
}
The text was updated successfully, but these errors were encountered:
you can use the Target attribute of the DI component to select a specific autowiring alias for an interface (without having to rename the arguments), as supported by Symfony for any interface with multiple autowirable aliases.
The WithMonologChannel attribute maps to autoconfiguring the monolog.logger tag (with the appropriate channel attribute) in MonologBundle, which is a behavior that exists at the level of the definition, not at the level of an argument.
MonologBundle cannot easily add support for using the WithMonologChannel at the argument level (I actually don't see how to implement that without reimplementing a big part of the wiring ourselves, which is definitely not something I want to have to maintain in MonologBundle)
I have a service with multiple channel loggers.
I'd like to use
WithMonologChannel
attribute to define which logger is for which channel but that attribute currently applies only to the whole class. I'd like to have the ability to useWithMonologChannel
like this:The text was updated successfully, but these errors were encountered: