PHP logging library that is highly extendable and simple to use.
PHP logging library that is highly extendable and simple to use.
A minimal PHP logging package based on the idea of using closures
for configurability and extensibility. It functions as a static class, but you can
completely control the writing of log messages through a closure function
(aka anonymous functions),
or use the Analog\Logger wrapper that implements the
PSR-3 specification.
Install the latest version with:
$ composer require analog/analoghandler (Variable::init ($log));
$logger->alert ('Things are really happening right now!');
// With context
$logger->debug ('Testing {0}:{1}', [__FILE__, __LINE__]);
var_dump ($log);mydb->log->insert ($info);
});
// Log an alert
Analog::log ('The sky is falling!', Analog::ALERT);
// Log some debug info
Analog::log ('Debugging info', Analog::DEBUG);Analog uses a simple autoloader internally, so if you don't have access to composer you can clone this repository and include it like this:
What about Analog, the logfile analyzer? Well, since it hasn't been updated
> since 2004, I think it's safe to call a single-file PHP logging class the
> same thing without it being considered stepping on toes :)No open issues yet, or sync has not completed.