Php log error exception handling

Source: Internet
Author: User
PHP outputs all error report error_reportingE_ALL settings. for example, the error message error_reportingE_ALL & amp; ~ is not displayed ;~ E_WARNING use the PHP function to set PHP. INIini_set () such as ini_set (error_reporting, E_ALL) to obtain the value in PHP. ini. you can use the function ini_ge...

PHP outputs all error reports error_reporting = E_ALL settings

For example, do not display warning error_reporting = E_ALL &~ E_WARNING

 

Use the PHP function to set PHP. INI ini_set () as shown in figure

Ini_set ("error_reporting", E_ALL)

You can use the ini_get () function to obtain the value in PHP. ini ()

For example, ini_get ("upload_max_filesize ")

PHP does not display the error report. display_errors = off is set in PHP. ini.

 

We need to enable the error report in the development stage, and do not enter any error report in the runtime stage (display_errors = Off)

Write the error report to the log

 

1: specify the output error report error_reproting = E_ALL

2: disable error output display_errors = Off

3: enable the error log function log_errors = On

 

@ By default, the error log location is not specified, and is written to the web server logs by default.

@ Specify a file name for error_log (where the log is stored)

@ Use error_log = syslog to write logs to the operating system


Rootexp

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.