Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

inject multiple logger symfony

# App/Subscribers/WebhookLoggingListener.php file
public function __construct(
    LoggerInterface $logger, 
    LoggerInterface $mailgunLog, 
    LoggerInterface $dripLog) {
}

# services.yml
AppSubscribersWebhookLoggingListener:
    arguments:
        $logger: "@logger"
        $mailgunLog: "@monolog.logger.mailgun"
        $dripLog: "@monolog.logger.drip"
    tags:
       - { name: kernel.event_listener, event: kernel.request, method: onKernelRequest }
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #inject #multiple #logger #symfony
ADD COMMENT
Topic
Name
5+1 =