Sometimes it is needed to allow user to specify external file with parameters you want to use in config. For example path to the log file is stored in external log.yml while it is needed for monolog configuration in config.yml.

So as you can see the %log.path% and %log.level%are in external file and path to that file is configured in parameters.yml. If you try to run Symfony like this it will complain that parameters %log.path% and %log.level% are missing.

The required behaviour is easily achievable thanks to Symfony\Component\DependencyInjection\Extension\PrependExtensionInterface. It is briefly described in the Symfony documentation.

Using this snippet parameters %log.path% and %log.level% will be successfully preloaded and available in config.yml .

Andrey Stepanov

Engineering Manager / Agile Coach

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store