Skip to content

Latest commit

 

History

History
28 lines (18 loc) · 858 Bytes

how-to-change-consume-command-logger.md

File metadata and controls

28 lines (18 loc) · 858 Bytes

How to change consume command logger

By default bin/console enqueue:consume (or bin/console enqueue:transport:consume) command prints messages to output. The amount of info could be controlled by verbosity option (-v, -vv, -vvv).

In order to change the default logger used by a command you have to register a LoggerExtension just before the default one. The extension asks you for a logger service, so just pass the one you want to use. Here's how you can do it.

// config/services.yaml

services:
    app_logger_extension:
        class: 'Enqueue\Consumption\Extension\LoggerExtension'
        public: false
        arguments: ['@logger']
        tags:
            - { name: 'enqueue.consumption.extension', priority: 255 }

The logger extension with the highest priority will set its logger.

back to index