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 was playing with #[WithMonologChannel] attribute. Without reading the doc, I put it on the constructor parameter, because I thought it would work like #[Target], #[Autowire], ... attributes
it also require changing entirely the way the processing is implemented. Right now, this attribute only applies the tag on the service definition, which then defines a binding.
To support separate channels in different arguments, it would require hooking directly in the autowiring logic instead.
Can you try using the Target attribute of the DI component instead ? I think it might work already for known channels thanks to the registration done in
(channels become known either because of a monolog.channel tag asking them to be created or because of the dedicated channels setting in the bundle configuration)
Hello,
I was playing with
#[WithMonologChannel]
attribute. Without reading the doc, I put it on the constructor parameter, because I thought it would work like#[Target]
,#[Autowire]
, ... attributesBut, what a surprise, it didn't work.
Instead it must be set on the class
What about allowing it on the parameter instead ? It feels more natural. And it allows having N different logger
WDYT ?
The text was updated successfully, but these errors were encountered: