An in-depth understanding of PHP error and logging functions _php Tutorial

Source: Internet
Author: User
Tags php error
Introduction to PHP Error and logging
The error and logging functions allow you to manipulate and record errors.
The error function allows the user to define a rule for handling errors and to modify how errors are logged.
The logging function allows users to log applications and send log messages to e-mail, system logs, or other machines.

Installation
The error and logging functions are part of the PHP core. These functions can be used without installation.
PHP Error and Logging functions

PHP: Indicates the earliest version of PHP that supports this function.
Function Description PHP
Debug_backtrace () generates BackTrace. 4
Debug_print_backtrace () output backtrace. 5
Error_get_last () Gets the last error that occurred. 5
Error_log () sends an error to the server error record, file, or remote destination. 4
Error_reporting () specifies which error to report. 4
Restore_error_handler () Restores the previous error handler. 4
Restore_exception_handler () Restores the previous exception handler. 5
Set_error_handler () Sets the user-defined error-handling function. 4
Set_exception_handler () Sets the user-defined exception handling function. 5
Trigger_error () Creates a user-defined error message. 4
Alias of User_error () Trigger_error (). 4
PHP Error and Logging constants

PHP: Indicates the earliest version of PHP that supports this constant.
Value constants describe PHP
1 E_error Fatal Run-time error. The error cannot be recovered. Execution of the script was interrupted.
2 e_warning non-fatal run-time error. The execution of the script is not interrupted.
4 E_parse Compile-time syntax parsing error. Parsing errors should only be generated by the parser.
8 E_notice Run-time prompt. May be an error, or it may occur when the script is running normally.
E_core_error errors generated internally by PHP. 4
E_core_warning generated by PHP internal warning. 4
E_compile_error errors generated internally by the Zend scripting engine. 4
E_compile_warning a warning generated internally by the Zend scripting engine. 4
E_user_error because of a run-time error generated by calling the Trigger_error () function. 4
E_user_warning a run-time warning generated by calling the Trigger_error () function. 4
1024x768 E_user_notice The runtime prompt generated by calling the Trigger_error () function. 4
2048 e_strict run-time prompt. Benefit from enhanced code interoperability and compatibility. 5
4096 E_recoverable_error A fatal error that can be captured. (see Set_error_handler ()) 5
8191 E_all all errors and warnings except E_strict. 5

http://www.bkjia.com/PHPjc/327246.html www.bkjia.com true http://www.bkjia.com/PHPjc/327246.html techarticle Introduction to PHP Error and logging the error and logging functions allow you to process and record errors. The error function allows the user to define a rule for handling errors and to modify how errors are logged. L ...

  • 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.