PHP code example of marcuspi / doctrine-log-bridge

1. Go to this page and download the library: Download marcuspi/doctrine-log-bridge library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

marcuspi / doctrine-log-bridge example snippets




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);