PHP code example of frank-houweling / zend-log-doctrine-writer

1. Go to this page and download the library: Download frank-houweling/zend-log-doctrine-writer 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/ */

    

frank-houweling / zend-log-doctrine-writer example snippets


$em = $container->get(EntityManager::class);
$doctrineWriter = new DoctrineWriter($em, LogMessage::class);

$logger = new Logger();
$logger->addWriter($doctrineWriter);

$mapping = [
    'message' => 'msg'
];

$em = $container->get(EntityManager::class);
$doctrineWriter = new DoctrineWriter($em, LogMessage::class, $mapping);

$logger = new Logger();
$logger->addWriter($doctrineWriter);