PHP code example of benycode / doctrine-psr-logger

1. Go to this page and download the library: Download benycode/doctrine-psr-logger 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/ */

    

benycode / doctrine-psr-logger example snippets


EntityManager::class => static function (ContainerInterface $container): EntityManager {
  ...
		
  $logger = .....
    ->addFileHandler('database.log')
    ->createLogger()
  ;
		
  $config
    ->setSQLLogger(new \BenyCode\DoctrinePsrLogger\PsrSqlLogger($logger))
  ;
  
  return EntityManager::create($settings['db'], $config);
},