In Symfony 5.4, and by using monolog 3.8. I want to log the request handling of a specifique controller, in a new log file . for my case is citiesController
this my monolog config.
monolog:
channels:
- deprecation
- cities_controller
when@dev:
monolog:
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
cities_controller_log:
type: stream
path: "%kernel.logs_dir%/CitiesController.log"
level: debug
channels: ['cities_controller']
console:
type: console
process_psr_3_messages: false
channels: ["!event", "!doctrine", "!console"]
I expect to get the logs of the cities controller in a new file called citiesController.log
but as far as I check the log file doesn’t get created .
I get the logs in var/dev.logs