earlhickey / pg-logger
ZF2 logging module
0.2.1
2015-06-19 14:23 UTC
Requires
- php: >=5.3.3
- firephp/firephp-core: ~0.4
- zendframework/zendframework: 2.*
This package is not auto-updated.
Last update: 2024-12-21 19:00:41 UTC
README
ZF2 Logging Module
Log to DB, Email, File, Syslog, FirePHP. Fully customizable with config file.
Call logger directly or with triggers.
Installation
Main Setup
By cloning project
- Install the PgLogger ZF2 module
by cloning it into
./vendor/
. - Clone this project into your
./vendor/
directory.
With composer
-
Add this project in your composer.json:
"require": { "earlhickey/pg-logger": "0.*" }
-
Now tell composer to download PgLogger by running the command:
$ php composer.phar update
Post installation
-
Enabling it in your
application.config.php
file.<?php return array( 'modules' => array( // ... 'PgLogger', ), // ... );
-
Copy
./vendor/earlhickey/PgLogger/config/pg-logger.global.php.dist
to./config/autoload/pg-logger.global.php
and change the values as desired. -
Create directory
data/log
in the root of your ZF2 project.
Usage
- Call the logger service directly:
$this->getServiceLocator()->get('PgLogger\Service\Logger')->crit('test');
- Use triggers:
$this->getEventManager()->trigger('log', $this, array('message' => $message, 'priority' => Logger::CRIT));
- message
- priority is optional (default: INFO)