mariusbalcytis / gentle-force-bundle

Symfony bundle for brute-force, error and request rate limiting
MIT License
54 stars 14 forks source link

Also check for alias in the logger compiler pass #4

Closed angeleg closed 6 years ago

angeleg commented 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.

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.

mariusbalcytis commented 6 years ago

Thanks!