t4web / log
ZF2 Module. For logging anything
1.0.5
2016-09-22 15:00 UTC
Requires
- php: >=5.5 || ^7.0
- t4web/crud: ~1.0.0
- t4web/domain-module: ~1.2.0
- t4web/infrastructure: ~1.2.0
- zendframework/zend-console: ~2.5.0
- zendframework/zend-db: ~2.5.0
- zendframework/zend-mvc: ~2.5.0
- zendframework/zend-servicemanager: ~2.5.0
Suggests
- t4web/admin: for showing log in admin
README
ZF2 Module. For logging anything
Installation
Main Setup
By cloning project
Clone this project into your ./vendor/
directory.
With composer
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
Post installation
Enabling it in your application.config.php
file.
<?php return array( 'modules' => array( // ... 'T4web\Log', ), // ... );
Configuring
For define custom scopes, describe it in config:
't4web-log' => [ 'scopes' => [ 'general' => 1, 'payments' => 2, 'users' => 3, 'background-jobs' => 4, ], ],
Using
$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__]);