public static function info($message, array $content = array(), $module = '') { self::setLogPath(); if ($module != '') { \SeasLog::info($message, $content, $module); } else { \SeasLog::info($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 neeke@php.net */ ini_set('seaslog.disting_type', 1); $countResult = SeasLog::analyzerCount(); ini_set('seaslog.disting_type', 1); SeasLog::setBasePath(realpath('.')); SeasLog::setLogger('log'); SeasLog::info('log info test'); print_r($countResult);
<?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');