blob: 04c6770cf19b0ea5949245fe5c4b1c587248fad1 [file] [log] [blame]
<?php
require_once 'tutorial_autoload.php';
class customLazyLogConfiguration implements ezcBaseConfigurationInitializer
{
public static function configureObject( $log )
{
$writeAll = new ezcLogUnixFileWriter( "/tmp/logs", "general.log" );
$log->getMapper()->appendRule( new ezcLogFilterRule( new ezcLogFilter, $writeAll, true ) );
}
}
ezcBaseInit::setCallback(
'ezcInitLog',
'customLazyLogConfiguration'
);
// Use log
$log = ezcLog::getInstance();
$log->log( "Paid with credit card.", ezcLog::SUCCESS_AUDIT, array( "category" => "shop" ) );
$log->log( "The credit card information is removed.", ezcLog::NOTICE, array( "category" => "shop" ) );
?>