I am building a e-commerce application under symfony 4.0. The application is getting complex and I want to log the process. I would like to log it in a specific log file.
For that I have create a new monolog handler : monolog.yaml :
monolog:
handlers:
main:
type: stream
path: "%kernel.logs_dir%/%kernel.environment%.log"
level: debug
channels: ["!event"]
youshoes:
level: info
type: stream
path: "%kernel.logs_dir%/%kernel.environment%YOUSHOES.log"
channels: [youshoes]
channels: ["main", "youshoes"]
How can I use this log now. for example :
$logger->info('Client has validated is cart');
$logger->info('Payment is successful');
$logger->info('Client is requesting for deliveries');
etc ....
To be in the right log file..
Thanks a lot for your help.
Pierre.