2017 © Pedro Peláez
 

library pilog

A simple PHP logging system which is PSR-2, PSR-3 and PSR-4 compliable.

image

svile/pilog

A simple PHP logging system which is PSR-2, PSR-3 and PSR-4 compliable.

  • Sunday, September 28, 2014
  • by svile
  • Repository
  • 3 Watchers
  • 26 Stars
  • 43 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 3 Forks
  • 0 Open issues
  • 4 Versions
  • 0 % Grown

The README.md

NOTE: This project is no longer maintained

Pilog

A simple PHP logging system which is PSR-3 and PSR-4 compliable., (*1)

Installation via Composer

Simply add a dependency on svile/pilog to your project's composer.json file if you use Composer to manage the dependencies of your project. Here is a minimal example of a composer.json file that just defines a development-time dependency on Pilog:, (*2)

{
    "require": {
        "svile/pilog": "*"
    }
}

Usage

Global

In order to use the global logger, you'll need to set it up first. However, non of the settings below are mandatory. If you skip the set function, the default log level will be set. If you skip the output, then nothing will be written anywhere and no exceptions will be thrown., (*3)

// Set the log level. Blank function call yields LogLevel::DEBUG
Svile\Pilog\Log::set(LogLevel::ERROR);
// Set the output. -> /path/to/file/mainlog.log
Svile\Pilog\Log::setOutput(new File('/path/to/file', 'mainlog'));

After you've set it up, you can call it from anywhere within your application, (*4)

Svile\Pilog\Log::error('Something went terribly wrong');

Local

Very similar the global usage, where all the settings and default values apply, except you'll need to instantiate the class here, (*5)

// Set the log level. Blank function call yields LogLevel::DEBUG
$logger = new  Svile\Pilog\Logger(LogLevel::INFO);
$logger->setOutput(new File('/path/to/file', 'mainlog'));
// it is time to move on
$logger->notice('Start coding');

The Versions

28/09 2014

dev-master

9999999-dev

A simple PHP logging system which is PSR-2, PSR-3 and PSR-4 compliable.

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

psr file logging pilog

28/09 2014

1.0.3

1.0.3.0

A simple PHP logging system which is PSR-2, PSR-3 and PSR-4 compliable.

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

psr file logging pilog

11/08 2014

1.0.2

1.0.2.0

A simple PHP logging system which is PSR-2, PSR-3 and PSR-4 compliable.

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

psr file logging pilog

12/07 2014

1.0.0

1.0.0.0

A simple PHP logging system which is PSR-3 and PSR-4 compliable.

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

psr file logging pilog