PHPerror_log () function

Source: Internet
Author: User
Tags server error log
The error_log () function sends an error to the server error log, file, or remote target.

Error_log () is a debugging function of PHP, which is very good.

Definition and usage

The error_log () function sends an error to the server error log, file, or remote target.

If the call succeeds, true is returned. otherwise, false is returned.

Syntax
Error_log (error, type, destination, headers)
Parameters Description
Error Required. The error message to be logged.
Type

Optional. Specifies the error record type.

Possible record types:

  • 0-default. According to the error_log configuration in the php. ini file, errors are sent to the server log system or file.
  • 1-the error is sent to the address in the destination parameter. Only the headers parameter is used for this type.
  • 2-send an error through the PHP debugging connection. This option is only available in PHP 3.
  • 3-the error message is sent to the target string of the file.
Destination Optional. Specifies where to send an error message. The value of this parameter depends on the value of the "type" parameter.
Headers

Optional. It is only used when "type" is 1.

Specify additional headers, such as From, Cc, and Bcc. Separated by CRLF (\ r \ n.

Note: The From header must be included when an email is sent. You can use this parameter in the php. ini file.

If type is 3, destination is the target path...


Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.