Skip to content

Instantly share code, notes, and snippets.

@ihabunek
Created June 12, 2013 13:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ihabunek/5765463 to your computer and use it in GitHub Desktop.
Save ihabunek/5765463 to your computer and use it in GitHub Desktop.
<?php
require 'vendor/autoload.php';
Logger::configure(array(
'appenders' => array(
'default' => array(
'class' => 'LoggerAppenderFile',
'layout' => array(
'class' => 'LoggerLayoutSimple',
),
'params' => array(
'file' => 'file.log',
'append' => false
),
),
),
'rootLogger' => array(
'appenders' => array('default'),
),
));
$log = Logger::getLogger('foo');
while(true)
{
$log->info("bar");
echo "\n---\n";
echo file_get_contents('file.log');
sleep(1);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment