This library is no longer maintained. Fork of monolog compatible with PHP 5.2+.
monolog is a fantastic logging library, but it's only compatible with PHP 5.3+. While 97% of PHP servers run PHP 5.2 or higher, 32% of all servers are still running PHP 5.2 or lower (source). It would be a shame to exempt this library from nearly a third of the world's servers just because of a few version incompatibilities.
Once PHP 5.3+ adoption levels near closer to 100%, this library will be retired.
<?php
// create a log channel
$log = new ehough_epilog_Logger('name');
$log->pushHandler(new ehough_epilog_handler_StreamHandler('path/to/your.log', ehough_epilog_Logger::WARNING));
// add records to the log
$log->addWarning('Foo');
$log->addError('Bar');
Differences from monolog
The primary difference is naming conventions of monolog's classes. Instead of the \Monolog
namespace
(and sub-namespaces), instead prefix the class names with ehough_epilog
and follow the PEAR
naming convention.
A few examples of class naming conversions:
\Monolog\Logger -----> ehough_epilog_Logger
\Monolog\Handler\StreamHandler -----> ehough_epilog_handler_StreamHandler
\Monolog\Processor\MemoryProcessor -----> ehough_epilog_processor_MemoryProcessor
Other "gotchas" when using epilog instead of monolog:
- The Gelf handler can only be used with PHP 5.3+
- The DoctrineCouchDBHandler can only be used with PHP 5.3+
- The RedisHandler can only be used with PHP 5.3+
epilog also adds a handy class for building ehough_epilog_Logger
instances: ehough_epilog_LoggerFactory
. You can use this factory to perform one-liner instantiations:
<?php
$logger = ehough_epilog_LoggerFactory::getLogger('name');
Any loggers built this way will share the same stack of handlers and processors, thereby reducing unnecessary memory overhead.
Releases are synchronized with the upstream monolog repository. e.g. ehough/epilog 1.6.0
has merged the code
from Seldaek/monolog 1.6.0
.