marcuspi / doctrine-log-bridge
Allows you to pass a PSR-3 compliant logger to Doctrine
1.0.0
2019-02-03 23:16 UTC
Requires
- php: ^7.1
- doctrine/dbal: ^2.9
- psr/log: ^1
Requires (Dev)
- php: ^7.3
- phpunit/phpunit: ^8.0
- squizlabs/php_codesniffer: ^3.4
This package is auto-updated.
Last update: 2024-11-04 22:06:20 UTC
README
PSR-3 log bridge for Doctrine's SQLLogger
Getting Started
Prerequisites
You need a PSR-3 logger and Doctrine's DBAL for this to make sense.
Installing
Download using composer
composer require marcuspi/doctrine-log-bridge
Then pass your favorite logger and the log level to the constructor
<?php use Marcuspi\DoctrineLogBridge\LogBridge; use \Psr\Log\LogLevel; // set up your logger, or get it from you dependency container or whatever /** @var \Psr\Log\LoggerInterface $logger */ $logBridge = new LogBridge($logger, LogLevel::INFO); // ... // Then, when setting up the DBAL: /** @var \Doctrine\DBAL\Configuration $config */ $config->setSQLLogger($logBridge);
Versioning
SemVer is used for versioning. For the versions available, see the tags on this repository.
Authors
- Marcus Pettersen Irgens - Initial work - marcusirgens
License
This project is licensed under the MIT License - see the LICENSE file for details