PHP error_log() Function
Complete PHP Error Reference Manual
Definition and Usage
The error_log() function sends an error to the server error log, a file, or a remote destination.
Returns TRUE on success, or FALSE on failure.
Syntax
error_log(error,type,destination,headers)
| Parameters | Description |
|---|---|
| error | Required. The error message to log. |
| type | Optional. Specifies the type of error logging. |
可能的记录类型:
Note:When sending email, a From header must be included. It can be set in the php.ini file or through this parameter.
|Example
The following example sends an email with a custom error:
1) { error_log("A custom error has been triggered", 1,"someone@example.com","From: webmaster@example.com"); } ?>The email received by the code above is shown below:
A custom error has been triggered
Complete PHP Error Reference Manual