PHP中日志相关处理

内置函数:

1.error_log() ,第三个参数不能是绝对路径,必须是相对路径。
写入文件:

error_log("warn:\nthis is a warn!\n",3,"1.txt");

发送邮件:

error_log("A custom error has been triggered",1,"someone@example.com","From: webmaster@example.com");

 

2.trigger_error(),用于在用户指定的条件下触发一个错误消息。它与内建的错误处理器一同使用.

trigger_error("A custom error has been triggered");

 

posted @ 2015-03-25 14:15  洒洒  阅读(330)  评论(0编辑  收藏  举报