I’ve tried searching across the documentation and symfony casts and looked in some of the major bundles and I’ve not seen anything quite right.
So where I work they follow a microservice architecture with dozens of small symfony applications. Common code is put into various seperate bundle/library repositories. So far all good.
However as the number of symfony applications grows keeping sensible logging configuration becomes more and more of a challenge and we find it tricky to keep the configuration in sync, some applications use the latest set of logging handlers and others are missing handlers or using older handlers. Each application has it’s own ./config/package/monolog.yaml
.
Is there a way to move this configuration from the symfony applications into a bundle lets call it ACMEBundle
and have that configuration for monolog
provided to all the symfony applications that use ACMEBundle
. In the bundle could it still live in ./config/package/monolog.yaml
or would it have to be elsewhere? Does the bundle library require any method or Extension class to ensure the configuration is registered in the symfony applications that use it?
The example I see are how to create bundles where the parent application service is then able to set configuration in the bundle. But instead I’m curious is it possible for an application to use a bundle that uses a bundle, where the middle bundle defines the configuration so the application doesn’t have to.
In short:
how can I get ACMEApplication[1,2,3,4,5]
are symfony apps to use one ACMEBundle
which defines package configuration for the MonologBundle
.