Skip to content

Latest commit

 

History

History
34 lines (23 loc) · 922 Bytes

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

File metadata and controls

34 lines (23 loc) · 922 Bytes
layout nav_exclude
default
true

{% include support.md %}

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