php简单日志写入函数
function showLog($content,$filename="filenamelog")
{
$logfile = 'logs/'.$filename.date('Ymd').'.txt';
if(!file_exists(dirname($logfile)))
{
mkdir(dirname($logfile));
}
error_log(date("[Y-m-d H:i:s]")."-[".$_SERVER["REMOTE_ADDR"]."]\t[".$_SERVER['REQUEST_URI']."]:".$content."\n", 3,$logfile);
}
showLog("");