2017 © Pedro Peláez
 

library phplog

This package contains simple PSR logger that minimizes line length.

image

joefallon/phplog

This package contains simple PSR logger that minimizes line length.

  • Sunday, December 27, 2015
  • by jfallon
  • Repository
  • 1 Watchers
  • 0 Stars
  • 82 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 12 Versions
  • 0 % Grown

The README.md

phplog

By Joe Fallon, (*1)

A simple logging library. It has the following features:, (*2)

  • Full suite of unit tests.
  • It can be integrated into any existing project.
  • Can be fully understood in just a few moments.
  • Each line of log text contains minimal prefix cruft.
  • Fully psr/log compliant.

Installation

The easiest way to install PhpDatabase is with Composer. Create the following composer.json file and run the php composer.phar install command to install it., (*3)

{
    "require": {
        "joefallon/phplog": "*"
    }
}

Usage

There is one class contained in this library called Log. It contains the following methods:, (*4)

__construct($filePath, $level)
emergency($message, array $context = array())
alert($message, array $context = array())
critical($message, array $context = array())
error($message, array $context = array())
warning($message, array $context = array())
notice($message, array $context = array())
info($message, array $context = array())
debug($message, array $context = array())
log($level, $message, array $context = array())

Example log entrys with contexts looks like this:, (*5)

2015-02-05 10:35:20 [DEBUG] Test debug. {"contextKey":"contextVal"}
2015-02-05 10:35:20 [INFO] Test info. {"contextKey":"contextVal"}
2015-02-05 10:35:20 [LOG] Test notice. {"contextKey":"contextVal"}
2015-02-05 10:35:20 [WARN] Test warning. {"contextKey":"contextVal"}
2015-02-05 10:35:20 [ERROR] Test error. {"contextKey":"contextVal"}
2015-02-05 10:35:20 [CRITICAL] Test critical. {"contextKey":"contextVal"}
2015-02-05 10:35:20 [ALERT] Test alert. {"contextKey":"contextVal"}
2015-02-05 10:35:20 [EMERGENCY] Test emergency. {"contextKey":"contextVal"}
2015-02-05 10:35:20 [ALERT] Test off message. {"contextKey":"contextVal"}

Example log entrys without contexts looks like this:, (*6)

2015-02-05 10:35:20 [DEBUG] Test debug.
2015-02-05 10:35:20 [INFO] Test info.
2015-02-05 10:35:20 [LOG] Test notice.
2015-02-05 10:35:20 [WARN] Test warning.
2015-02-05 10:35:20 [ERROR] Test error.
2015-02-05 10:35:20 [CRITICAL] Test critical.
2015-02-05 10:35:20 [ALERT] Test alert.
2015-02-05 10:35:20 [EMERGENCY] Test emergency.
2015-02-05 10:35:20 [ALERT] Test off message.

Open Log and Write a Debug Message

$logger = new Log('/tests/logs/' . date('Y-m-d') . '.log', Log::DEBUG);
$logger->debug('Test debug.', array('contextKey' => 'contextVal'));

The Versions

27/12 2015

dev-master

9999999-dev https://github.com/joefallon/phplog

This package contains simple PSR logger that minimizes line length.

  Sources   Download

MIT

The Requires

 

The Development Requires

logger log

27/12 2015

dev-develop

dev-develop https://github.com/joefallon/phplog

This package contains simple PSR logger that minimizes line length.

  Sources   Download

MIT

The Requires

 

The Development Requires

logger log

27/12 2015

v3.1.2

3.1.2.0 https://github.com/joefallon/phplog

This package contains simple PSR logger that minimizes line length.

  Sources   Download

MIT

The Requires

 

The Development Requires

logger log

05/02 2015

v3.1.1

3.1.1.0 https://github.com/joefallon/phplog

This package contains simple to use logger

  Sources   Download

MIT

The Requires

 

The Development Requires

logger log

28/10 2014

v3.1.0

3.1.0.0 https://github.com/joefallon/phplog

This package contains simple to use logger

  Sources   Download

MIT

The Requires

 

The Development Requires

database php dbal

26/10 2014

v3.0.0

3.0.0.0 https://github.com/joefallon/phplog

This package contains simple to use logger

  Sources   Download

MIT

The Requires

 

The Development Requires

database php dbal

22/10 2014

v2.0.1

2.0.1.0 https://github.com/joefallon/phplog

This package contains simple to use logger

  Sources   Download

MIT

The Requires

 

The Development Requires

database php dbal

20/10 2014

v2.0.0

2.0.0.0 https://github.com/joefallon/phplog

This package contains simple to use logger

  Sources   Download

MIT

The Requires

 

The Development Requires

database php dbal

29/08 2014

v1.0.3

1.0.3.0 https://github.com/joefallon/phplog

This package contains simple to use logger

  Sources   Download

MIT

The Requires

 

The Development Requires

database php dbal

19/07 2014

v1.0.2

1.0.2.0 https://github.com/joefallon/phplog

This package contains simple to use logger

  Sources   Download

MIT

The Requires

 

The Development Requires

database php dbal

19/07 2014

v1.0.1

1.0.1.0 https://github.com/joefallon/phplog

This package contains simple to use logger

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

The Development Requires

database php dbal

18/07 2014

v1.0.0

1.0.0.0 https://github.com/joefallon/phplog

This package contains simple to use logger

  Sources   Download

MIT

The Requires

  • php >=5.3.0

 

The Development Requires

database php dbal