public static function error($message, array $content = array(), $module = '') { self::setLogPath(); if ($module != '') { \SeasLog::error($message, $content, $module); } else { \SeasLog::error($message, $content); } }
function test_log() { $iCount = 10000; while ($iCount-- > 0) { SeasLog::error(format(array('msg' => "HelloWorld", 'id' => $iCount), "__main__", '123'), array(), 'test1'); } $iCount = 10000; while ($iCount-- > 0) { SeasLog::info(format(array('msg' => "HelloWorld", 'id' => $iCount), "__main__", '123'), array(), 'test2'); } $iCount = 10000; while ($iCount-- > 0) { SeasLog::debug(format(array('msg' => "HelloWorld", 'id' => $iCount), "__main__", '123')); } }
<?php /** * @author ciogao@gmail.com * Date: 15-10-17 下午4:12 */ var_dump(SEASLOG_DETAIL_ORDER_ASC); var_dump(SEASLOG_DETAIL_ORDER_DESC); var_dump(SeasLog::getBasePath()); var_dump(SeasLog::getLastLogger()); SeasLog::debug('debug test'); SeasLog::error('错误{aaa}', array('{aaa}' => 'bbb')); SeasLog::error('错误{aaa}', array('{aaa}' => 'ccc'), 'cc'); SeasLog::log('error', '错误{aaa}', array('{aaa}' => 'ddd')); SeasLog::log('asdf', '错误{aaa}', array()); //Seaslog::debug("test"); var_dump(SeasLog::analyzerCount()); var_dump(Seaslog::analyzerDetail("all", "*", NULL, 1, 10, SEASLOG_DETAIL_ORDER_DESC)); var_dump(SeasLog::analyzerCount(SEASLOG_ALL)); var_dump(Seaslog::analyzerDetail(SEASLOG_ERROR, "*", NULL, 1, 1000, SEASLOG_DETAIL_ORDER_DESC)); var_dump(SeasLog::analyzerCount(SEASLOG_DEBUG)); var_dump(Seaslog::analyzerDetail(SEASLOG_DEBUG));
<?php /** * @author neeke@php.net * Date: 15-11-9 下午7:16 */ for ($i = 0; $i < 100; $i++) { SeasLog::error(time()); sleep(1); var_dump(SeasLog::getBuffer()); }
public static function errorCallBack($type, $error, $callinfo) { SeasLog::error(json_encode(array($type, $error, $callinfo))); }
<?php /** * @Author: leandre * @Date: 2015-10-15 11:08:43 * @Last Modified by: leandre * @Last Modified time: 2015-10-15 11:15:24 */ SeasLog::setBasePath('./logs/'); SeasLog::setLogger('test'); SeasLog::info('this is a info log'); SeasLog::notice('this is a notice log'); SeasLog::flushBuffer(); sleep(60); SeasLog::error('a error log'); SeasLog::critical('some thing was critical');