In PHP, the error log is stored in the System log (Windows system), PHP log
"Log errors to the system log"
In php.ini, set Error_log to:
Copy the Code code as follows:
Error_log = syslog
Or, use the Ini_set () function setting at run time.
"Example 1"
<?php//off error display Ini_set (' display_errors ', 0);//Turn On Error log function ini_set (' log_errors ', ' on ');//Set error log path Ini_set (' Error_ Log ', ' syslog ');//Display all error error_reporting (-1);//Error recording error//notification level echo $test; Warning Settype ($var, ' Dee ');//Fatal error Test ();
To view the error log (Windows system):
My Computer----Right-click-----Manage-----Event Viewer-----Information
"Example 2" sends the system log via Openlog ()
<?php//off error display Ini_set (' display_errors ', 0);//Turn On Error log function ini_set (' log_errors ', ' on ');//Set error log path Ini_set (' Error_ Log ', ' syslog ');//Display all error error_reporting (-1);//Open System Log Connection Openlog (' PHP5.3.10 ', Log_pid, Log_syslog); Openlog:open connection to System logger//send log syslog (Log_err, ' This is a test of a syslog '. Date ("y-m-d h:i:s");//Shut down the system log The connection closelog ();
You can also see the log in the Event Viewer warning message:
http://www.bkjia.com/PHPjc/1021091.html www.bkjia.com true http://www.bkjia.com/PHPjc/1021091.html techarticle In PHP, the error log is saved in the System log (Windows system), the PHP log "logs the error to the system log" in PHP.ini set Error_log to: Copy code code as follows ...