2017 © Pedro Peláez
 

library log

ZF2 Module. For logging anything

image

t4web/log

ZF2 Module. For logging anything

  • Thursday, September 22, 2016
  • by maxgu
  • Repository
  • 3 Watchers
  • 0 Stars
  • 103 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 7 Versions
  • 6 % Grown

The README.md

Log

ZF2 Module. For logging anything, (*1)

Installation

Main Setup

By cloning project

Clone this project into your ./vendor/ directory., (*2)

With composer

Add this project in your composer.json:, (*3)

"require": {
    "t4web/log": "~1.0.0"
}

Now tell composer to download Authentication by running the command:, (*4)

$ php composer.phar update

Post installation

Enabling it in your application.config.phpfile., (*5)

<?php
return array(
    'modules' => array(
        // ...
        'T4web\Log',
    ),
    // ...
);

Configuring

For define custom scopes, describe it in config:, (*6)

'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__]);

If you use t4web\admin it will looks like this: log list, (*7)

The Versions