|
[U]复制代码[/U] 代码如下:
getMessage());
}
//record operation log into .log file
function logger($log_content)
{
print_r(date('H:i:s')." ".$log_content."
");
$log_filename = date("Ymd").".log";
$file = fopen($log_filename ,"a+");
fwrite($file, date('H:i:s')." ".$log_content."\r\n");
fclose($file);
}
//record operation log into .log file
function logger2($log_content)
{
Global $max_size;
print_r(date('H:i:s')." ".$log_content." "."
");
$log_filename = date("Ymd").".log";
if(file_exists($log_filename) and (abs(filesize($log_filename)) > $max_size)){unlink($log_filename);sleep(1);}
file_put_contents($log_filename, date('H:i:s')." ".$log_content." "."\r\n", FILE_APPEND);
}
//error handler function
function myHandler($level, $message, $file, $line, $context)
{
logger("[ERROR] LEVEL: $level, MESSAGE: $message, FILE: $file, LINE: $line, CONTENT: $context");
die();
}
?>
原文网址:http://txw1958.cnblogs.com/
您可能感兴趣的文章:有关 PHP 和 MySQL 时区的一点总结PHP中设置时区方法小结PHP跨时区(UTC时间)应用解决方案深入解析PHP 5.3.x 的strtotime() 时区设定 警告信息修复php时区转换转换函数PHP中date与gmdate的区别及默认时区设置javascript+php实现根据用户时区显示当地时间的方法php输出全球各个时区列表的方法PHP中遇到的时区问题解决方法
|
|