2017 © Pedro Peláez
 

library zend-log-doctrine-writer

Doctrine Writer for Zend Log

image

frank-houweling/zend-log-doctrine-writer

Doctrine Writer for Zend Log

  • Wednesday, August 9, 2017
  • by FrankHouweling
  • Repository
  • 1 Watchers
  • 0 Stars
  • 2,054 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 2 Versions
  • 73 % Grown

The README.md

Doctrine Writer for Zend Log

This writer writes log messages to a given doctrine object., (*1)

Installation

Use composer to install this module., (*2)

composer require frank-houweling/zend-log-doctrine-writer

After composer installation, make sure that the \FrankHouweling\ZendLogDoctrineWriter module is added to the module configuration. In most cases, the module configuration can be found in config/module.config.php, (*3)

Usage

The Doctrine Writer can be used as any Zend Log Writer. It requires an instance of the Doctrine EntityManager, and a valid log entity classname. The log messages will be stored in the given entity, so make sure it is registered to the doctrine entitymanager., (*4)

The writer can be used as follows:, (*5)

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

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

A mapping can be given as a third parameter, to change the attributes in which log data is stored., (*6)

Example mapping:, (*7)

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

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

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

A basic entity that can be used for logging can be found in the src/Entity folder of the library., (*8)

The Versions

09/08 2017

dev-master

9999999-dev http://www.senet.nl/

Doctrine Writer for Zend Log

  Sources   Download

GPL-2.0

The Requires

 

logger logging zend zend framework doctrine zf3 zend log

09/08 2017

1.0

1.0.0.0 http://www.senet.nl/

Doctrine Writer for Zend Log

  Sources   Download

GPL-2.0

The Requires

 

logger logging zend zend framework doctrine zf3 zend log