ZF2 Module. For logging anything
Clone this project into your ./vendor/
directory.
Add this project in your composer.json:
"require": {
"t4web/log": "~1.0.0"
}
Now tell composer to download Authentication by running the command:
$ php composer.phar update
Enabling it in your application.config.php
file.
<?php
return array(
'modules' => array(
// ...
'T4web\Log',
),
// ...
);
For define custom scopes, describe it in config:
't4web-log' => [
'scopes' => [
'general' => 1,
'payments' => 2,
'users' => 3,
'background-jobs' => 4,
],
],
$logger = $this->getServiceLocator()->get(\T4web\Log\Logger::class);
$logger->log('general', 'test message');
$logger->log('general', 'test message', \T4web\Log\Logger::PRIORITY_ERR, ['file' => __FILE__, 'line' => __LINE__]);