Skip to content

WithMonologChannel but for property since I have multiple channels #1960

Open
@simPod

Description

@simPod

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 use WithMonologChannel like this:

class Foo {
    public function __construct(
        #[WithMonologChannel('foo')]
        LoggerInterface $aaaLogger,
        #[WithMonologChannel('bar')]
        LoggerInterface $bbbLogger
    )
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions