Simple Logger Powerful PSR-3 logging so easy it's simple!

Implements PHP Standard Recommendation interface: PSR-3 \Psr\Log\LoggerInterface

Log the following severities: debug, info, notice, warning, error, critical, alert, emergency. Log format: YYYY-mm-dd HH:ii:ss.uuuuuu [loglevel] [channel] [pid:##] Log message content {"Optional":"JSON Contextual Support Data"} {"Optional":"Exception Data"}

Standard usage - default options: $logger = new SimpleLog\Logger('logfile.log', 'channelname'); $logger->info('Normal informational event happened.'); $logger->error('Something bad happened.', ['key1' => 'value that gives context', 'key2' => 'some more context', 'exception' => $e]);

Optional constructor option: Set default lowest log level (Example error and above): $logger = new SimpleLog\Logger('logfile.log', 'channelname', \Psr\Log\LogLevel::ERROR); $logger->error('This will get logged'); $logger->info('This is below the minimum log level and will not get logged');

To log an exception, set as data context array key 'exception' $logger->error('Something exceptional happened.', ['exception' => $e]);

To set output to standard out (STDOUT) as well as a log file: $logger->setOutput(true);

To change the channel after construction: $logger->setChannel('newname')

Type hierarchy

amzn/amazon-pay-sdk-php 2.x-dev
psr/log dev-master 1.1.3
View more packages
amzn/login-and-pay-with-amazon-sdk-php 2.x-dev
ortnit/logger dev-master
psr-php7/log dev-master 1.0.0

Class usage:

This class is not referred by any other class/interface/traits in packagist packages.