I am currently running a Symfony 5 project in dev environment.
I would like to output requests logs (like 10:01:39 request.INFO Matched route "login_route"
) into a file.
I have the following config/packages/dev/monolog.yaml
file:
monolog:
handlers:
main:
type: stream
path: "%kernel.logs_dir%/%kernel.environment%.log"
level: debug
channels: [event]
With the YAML above, it logs correctly into the file /tmp/dev-logs/dev.log
when I execute bin/console cache:clear
.
But, it does not log anything when I perform requests on the application, no matter if I set channels: [request]
or channels: ~
or even no channel
param at all.
How can I edit the settings of that monolog.yaml
file in order to log request channel logs ?