2017 © Pedro Peláez
 

library doctrine-psr-sql-logger

PSR-3 Compliant Doctrine SQL Logger

image

abacaphiliac/doctrine-psr-sql-logger

PSR-3 Compliant Doctrine SQL Logger

  • Sunday, June 10, 2018
  • by abacaphiliac
  • Repository
  • 1 Watchers
  • 0 Stars
  • 1 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

doctrine-psr-sql-logger

PSR-3 Compliant Doctrine SQL Logger, (*1)

Scrutinizer Code Quality Code Coverage Build Status, (*2)

Installation

composer require abacaphiliac/doctrine-psr-sql-logger

Usage

The following configuration snippet will log the query with its parameter types and execution duration. In general, this will be safe to use with parameterized queries, since values will not be printed to the log stream., (*3)

$logger = new \Psr\Log\NullLogger(); // Get your real logger(s) from a container.
$configuration = new \Doctrine\DBAL\Configuration();
$configuration->setSQLLogger(new \Abacaphiliac\Doctrine\PsrSqlLogger($logger));

The following snippet will additionally log parameter values. Be careful to handle sensitive data appropriately., (*4)

$logger = new \Psr\Log\NullLogger(); // Get your real logger(s) from a container.
$configuration = new \Doctrine\DBAL\Configuration();
$configuration->setSQLLogger(new \Abacaphiliac\Doctrine\PsrSqlParamsLogger($logger));

Contributing

composer update && composer build

The Versions