I am working on a web app built using Symfony 2.6 and there are different configuration inside app/config folder. How do I know which one is being used.
Inside app/config I see config.yml config_dev.yml config_prod.yml and the monolog entry I see in config_dev.yml and also in monolog_prod.yml. It is as below.
monolog:
handlers:
main:
type: fingers_crossed
action_level: error
handler: nested
nested:
type: stream
path: "%kernel.logs_dir%/%kernel.environment%.log"
level: debug
console:
type: console
Now I want to use monolog to input some logs in a controller and put those logs separate form other logs. How can this be done?.
You know which one is used on your environment. If you are in dev mode you are using
config_dev.ymlmerged withconfig.ymlYou can check it into your virtual host if the file is onapp.phpyou are inprodmode, if the file points toapp_dev.phpyou are indevmode usuallyTo log into other files you can create a channel like this:
And into your controller you can call it in this way: