Some background/options:
- http://pear.php.net/package/Log
- https://github.com/Seldaek/monolog
- https://github.com/katzgrau/KLogger
- https://bitbucket.org/huntlyc/simple-php-logger
- https://github.com/jbroadway/analog
Refs:
| { | |
| "repositories": [ | |
| { | |
| "type": "pear", | |
| "url": "http://pear.php.net" | |
| } | |
| ], | |
| "require": { | |
| "pear-pear/Log": "*" | |
| } | |
| } |
| <?php | |
| require __DIR__ . '/vendor/autoload.php'; | |
| $conf = array('mode' => 0600, 'timeFormat' => '%X %x'); | |
| $logger = &Log::singleton('file', 'out.log', 'ident', $conf); | |
| for ($i = 0; $i < 10; $i++) { | |
| $logger->log("Log entry $i"); | |
| } | |
| /** | |
| # cat out.log | |
| 16:08:06 12/04/13 ident [info] Log entry 0 | |
| 16:08:06 12/04/13 ident [info] Log entry 1 | |
| 16:08:06 12/04/13 ident [info] Log entry 2 | |
| 16:08:06 12/04/13 ident [info] Log entry 3 | |
| 16:08:06 12/04/13 ident [info] Log entry 4 | |
| 16:08:06 12/04/13 ident [info] Log entry 5 | |
| 16:08:06 12/04/13 ident [info] Log entry 6 | |
| 16:08:06 12/04/13 ident [info] Log entry 7 | |
| 16:08:06 12/04/13 ident [info] Log entry 8 | |
| 16:08:06 12/04/13 ident [info] Log entry 9 | |
| */ |