2017 © Pedro Peláez
 

library logger

Logger component for SlaxWeb Framework

image

slaxweb/logger

Logger component for SlaxWeb Framework

  • Wednesday, April 19, 2017
  • by slax0r
  • Repository
  • 1 Watchers
  • 0 Stars
  • 1,026 Installations
  • PHP
  • 8 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 6 Versions
  • 0 % Grown

The README.md

Logger

The SlaxWeb\Logger component is only a simple wrapper around the Seldaek/monolog library to provide an easier integration into the SlaxWeb\Framework. It provides only a Service Provider for the Pimple Dependency Injection Container, and a Factory for instantiation of the logger library. The Logger component also depends on the Config component of the SlaxWeb\Framework., (*1)

Installation

Easiest method of installation is through composer, to install just edit your composer.json file to contain:, (*2)

{
    "require": {
        "slaxweb/logger": "~0.2"
    }
}

Usage

To instantiate the logger through the Factory you first need to instantiate the Config component, as the Factory will require it to successfully instantiate the logger. The Config component has to provide the following three configuration items: * logger.name - Used by Monolog as the name of the logger * logger.loggerType - Used to determine which Monolog Logger Handler to use for the logger, value needs to match the name of the Handler class, currently only StreamHandler is supported * logger.handlerArgs.logger.loggerType - Argument list that are going to be passed to the Handler instantiation, (*3)

When all of the above is set, you may safely call the Factory::init method, and you will retrieve an instance of the logger in return., (*4)

$logger = \SlaxWeb\Logger\Factory::init($config);

If you wish to use the Service Provider, then you need to make sure that the Config components Service Provider is registered prior to trying to accessing the logger definition. Of course, the above configuration items are required as well. All that remains to do is to register the Service Provider of the logger, and it will define the logger instantiation to the logger.service key name., (*5)

$container->register(new \SlaxWeb\Logger\Service\Provider);
$container["logger.service"]->addInfo("Logger loaded");

The Versions

19/04 2017

dev-master

9999999-dev

Logger component for SlaxWeb Framework

  Sources   Download

MIT

The Requires

 

by Tomaz Lovrec

19/04 2017

0.5.0

0.5.0.0

Logger component for SlaxWeb Framework

  Sources   Download

MIT

The Requires

 

by Tomaz Lovrec

18/02 2017

0.4.1

0.4.1.0

Logger component for SlaxWeb Framework

  Sources   Download

MIT

The Requires

 

by Tomaz Lovrec

18/02 2017

0.4.0

0.4.0.0

Logger component for SlaxWeb Framework

  Sources   Download

MIT

The Requires

 

by Tomaz Lovrec

10/01 2017

0.3.0

0.3.0.0

Logger component for SlaxWeb Framework

  Sources   Download

MIT

The Requires

 

by Tomaz Lovrec

20/03 2016

0.2.0

0.2.0.0

Logger component for SlaxWeb Framework

  Sources   Download

MIT

The Requires

 

by Tomaz Lovrec