Error_log
(PHP3, PHP4)
Error_log---&http://www.aliyun.com/zixun/aggregation/37954.html ">nbsp; send the wrong message to somewhere
Syntax: int error_log (string message, int message_type [, String destination [, String extra_headers]])
Description:
Send an error message to the Web server's error record, a TCP port, or a file. The first argument message is the content of an error that will be logged, and the second argument Message_type where to send the message:
Error_log () record type:
0 message to the system recorder in PHP, using the system recording mechanism of the operating system or file, depending on the error_log set value. 1 email message to the parameter destination specified address, only this form will be used to extra_headers, this form uses the same internal function mail (). 2 message sent to PHP to debug the link, only in the remote error set to enable, this option is valid. Parameter destination is used to specify the host name or IP address, port number, that receives the error message. 3 message appended to file destination.
Example:
<?php
Send notification through the server log if we can not
Connect to the database.
if (! Ora_logon ($username, $password)) {
Error_log ("Oracle Database Not available!", 0);
}
Notify Administrator by email if we run out of FOO
if (!) ( $foo = Allocate_new_foo ()) {
Error_log ("Big Trouble, we ' re all out of foos!", 1, "operator@mydomain.com");
}
Other ways of Calling Error_log ():
Error_log ("You messed up!", 2, "127.0.0.1:7000");
Error_log ("You messed up!", 2, "loghost");
Error_log ("You messed up!", 3, "/var/tmp/my-errors.log");
?>