PHP中日志相关处理

内置函数:

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

error_log("warn:
this is a warn!
",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");
原文地址:https://www.cnblogs.com/thinksasa/p/4365576.html