Skip to content

Instantly share code, notes, and snippets.

@siygle
Created July 15, 2011 18:45
Show Gist options
  • Save siygle/1085261 to your computer and use it in GitHub Desktop.
Save siygle/1085261 to your computer and use it in GitHub Desktop.
Monolog example
<?php
use Monolog\Logger;
use Monolog\Handler\StreamHandler;
//create a log channel
$log = new Logger('name');
$log->pushHandler(new StreamHandler('/path/to/log', Logger::WARNING));
// add records to the log
$log->addWarning('Foo');
$log->addError('Bar');
// autoload Monolog lib
function __autoload($class) {
$class = str_replace('\\', '/' , $class) . '.php';
require_once($class);
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment