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");
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.