Closed angeleg closed 6 years ago
The logger compiler pass only checks the container for a service whose id is 'logger', but for version <=3.0.0 of Monolog, 'logger' is only an alias for 'monolog.logger', not an id (see: https://github.com/symfony/monolog-bundle/blob/804425dfceec0097bf3e5dea3a73d91e055686be/DependencyInjection/MonologExtension.php#L55). Because of this, the logger used by the Gentle Force bundle defaults to NullLogger and logging fails to happen.
'logger'
<=3.0.0
'monolog.logger'
NullLogger
With this change, we check both for a service whose id is 'logger' OR for a service whose alias is 'logger'. This makes it compatible with versions of Monolog below 3.1.x.
3.1.x
Thanks!
The logger compiler pass only checks the container for a service whose id is
'logger'
, but for version<=3.0.0
of Monolog,'logger'
is only an alias for'monolog.logger'
, not an id (see: https://github.com/symfony/monolog-bundle/blob/804425dfceec0097bf3e5dea3a73d91e055686be/DependencyInjection/MonologExtension.php#L55). Because of this, the logger used by the Gentle Force bundle defaults toNullLogger
and logging fails to happen.With this change, we check both for a service whose id is
'logger'
OR for a service whose alias is'logger'
. This makes it compatible with versions of Monolog below3.1.x
.