gregoryv / php-logger
Basic logging for php
Installs: 1 226
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/gregoryv/php-logger
Requires (Dev)
- codeclimate/php-test-reporter: dev-master
- phpunit/phpunit: *
README
ARCHIVED! Moved to https://sogvin.com/php-logger
README
Logger module for basic intuitive logging in php. Severity levels are based on those for syslog found in RFC5424. This module is a starting point from which you can evolve your logging needs as your system grows. The simplest and default way of using it is
use gregoryv\logger\Logger;
$log = new Logger();
$log->info('something');
$x = 'something';
$log->debugf('Variable $x=%s', $x);
$log->turn('off debug'); // for this logger only
$log->debug('this will not be written');
$log->turn('off all warn'); // for this and all subsequently created loggers
The logger has methods for each severity level defined by RFC5424 6.2.1. That means you do not care much about where the messages end up initially, which surprisingly, is in the syslog.
Usage
Add to your composer.json
{
"require": {
"gregoryv/php-logger": "*"
}
}
