5

I am new to Symfony 5.3 and Monolog. The docu explains "the Symfony Framework organizes log messages into channels. By default, there are several channels, including doctrine, event, security, request and more."

Is there any way to find out what channels exactly are configured?

I tried to run php bin/console debug:config monolog but this only shows the channels I configured (e.g. by adding channels: ['myChannelA', 'channelB'] to the monolog.yaml)

I made no changes (beside adding custom channels, see above) to the default monolog config which was created on install:

// config/packages/dev/monolog.yaml
monolog:
    channels: ['myChannelA','channelB']
    handlers:
        main:
            type: stream
            path: "%kernel.logs_dir%/%kernel.environment%.log"
            level: debug
            channels: ["!event"]
        # uncomment to get logging in your browser
        # you may have to allow bigger header sizes in your Web server configuration
        #firephp:
        #    type: firephp
        #    level: info
        #chromephp:
        #    type: chromephp
        #    level: info
        console:
            type: console
            process_psr_3_messages: false
            channels: ["!event", "!doctrine", "!console"]

// config/packages/prod/monolog.yaml
monolog:
    handlers:
        main:
            type: fingers_crossed
            action_level: error
            handler: nested
            excluded_http_codes: [404, 405]
            buffer_size: 50 # How many messages should be saved? Prevent memory leaks
        nested:
            type: stream
            path: php://stderr
            level: debug
            formatter: monolog.formatter.json
        console:
            type: console
            process_psr_3_messages: false
            channels: ["!event", "!doctrine"]
1
  • I edited the question and added the monolog.yaml files. No changes were made beside adding two custom channels to check if they are listed when using php bin/console debug:config monolog. Other channels are not listed and not included in the config files. Commented Aug 12, 2021 at 5:04

2 Answers 2

5

You can try the following command:

php bin/console debug:autowiring | grep monolog

Sign up to request clarification or add additional context in comments.

Comments

0

php bin/console debug:autowiring log --all
would be an alternative for the same job ...

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.