PHP Error 和 Logging 简介
error 和 logging 函数允许你对错误进行处理和记录。
error 函数允许用户定义错误处理规则,并修改记录错误的方式。
logging 函数允许用户对应用程序进行日志记录,并把日志消息发送到电子邮件、系统日志或其他的机器。
安装
error 和 logging 函数是 PHP 核心的组成部分。无需安装即可使用这些函数。
PHP Error 和 Logging 函数
PHP:指示支持该函数的最早的 PHP 版本。
PHP Error 和 Logging 常量
PHP:指示支持该常量的最早的 PHP 版本。
值
常量
描述
PHP
1 |
E_ERROR |
致命的运行时错误。错误无法恢复。脚本的执行被中断。 |
|
2 |
E_WARNING |
非致命的运行时错误。脚本的执行不会中断。 |
|
4 |
E_PARSE |
编译时语法解析错误。解析错误只应该由解析器生成。 |
|
8 |
E_NOTICE |
运行时提示。可能是错误,也可能在正常运行脚本时发生。 |
|
16 |
E_CORE_ERROR |
由 PHP 内部生成的错误。 |
4 |
32 |
E_CORE_WARNING |
由 PHP 内部生成的警告。 |
4 |
64 |
E_COMPILE_ERROR |
由 Zend 脚本引擎内部生成的错误。 |
4 |
128 |
E_COMPILE_WARNING |
由 Zend 脚本引擎内部生成的警告。 |
4 |
256 |
E_USER_ERROR |
由于调用 trigger_error() 函数生成的运行时错误。 |
4 |
512 |
E_USER_WARNING |
由于调用 trigger_error() 函数生成的运行时警告。 |
4 |
1024 |
E_USER_NOTICE |
由于调用 trigger_error() 函数生成的运行时提示。 |
4 |
2048 |
E_STRICT |
运行时提示。对增强代码的互用性和兼容性有益。 |
5 |
4096 |
E_RECOVERABLE_ERROR |
可捕获的致命错误。(参阅 set_error_handler()) |
5 |
8191 |
E_ALL |
所有的错误和警告,除了 E_STRICT。 |
5 |
分享到:
相关推荐
PHP Error与Logging 简介error与logging 函数允许你对错误进行处理和记录。error 函数允许用户定义错误处理规则,并修改记录错误的方式。logging 函数允许用户对应用程序进行日志记录,并把日志消息发送到电子邮件、...
Error Handling and Logging Functions XXXII. Exif Functions XXXIII. File Alteration Monitor Functions XXXIV. filePro Functions XXXV. Filesystem 文件系统函数 XXXVI. Firebird/InterBase Functions XXXVII....
php实现的简单日志写入函数PHP调试函数和日志记录函数分享php基于自定义函数记录log日志方法php error_log 函数的使用PHP error_log()将错误信息写入一个文件(定义和用法)PHP中error_log()函数的使用方法PHP Error与...
Error Handling and Logging Functions XXXIII. Exif Functions XXXIV. Expect Functions XXXV. File Alteration Monitor Functions XXXVI. Forms Data Format Functions XXXVII. filePro Functions XXXVIII. ...
Error Handling and Logging Functions XXXII. Exif Functions XXXIII. File Alteration Monitor Functions XXXIV. filePro Functions XXXV. Filesystem 文件系统函数 XXXVI. Firebird/InterBase Functions XXXVII....
Error Handling and Logging Functions XXVII. File Alteration Monitor Functions XXVIII. FrontBase Functions XXIX. filePro Functions XXX. 文件系统函数库 XXXI. Forms Data Format Functions XXXII. FriBiDi ...
Errors and Logging — Error Handling and Logging Functions Exif — Exif Functions Expect — Expect Functions fam — File Alteration Monitor Functions FDF — Forms Data Format Functions Fileinfo — ...
Error Handling and Logging Functions XXXII. Exif Functions XXXIII. File Alteration Monitor Functions XXXIV. filePro Functions XXXV. Filesystem 文件系统函数 XXXVI. Firebird/InterBase Functions XXXVII....
Error Handling and Logging Functions XXXV. Exif Functions XXXVI. Expect Functions XXXVII. File Alteration Monitor Functions XXXVIII. Forms Data Format Functions XXXIX. Fileinfo Functions XL. filePro ...
Error Handling and Logging Functions XXXV. Exif Functions XXXVI. Expect Functions XXXVII. File Alteration Monitor Functions XXXVIII. Forms Data Format Functions XXXIX. Fileinfo Functions XL. ...
Error Handling and Logging Functions XXXII. Exif Functions XXXIII. File Alteration Monitor Functions XXXIV. filePro Functions XXXV. Filesystem 文件系统函数 XXXVI. Firebird/InterBase Functions ...
Errors and Logging — Error Handling and Logging Functions Exif — Exif Functions Expect — Expect Functions fam — File Alteration Monitor Functions FDF — Forms Data Format Functions Fileinfo — ...
Error Handling and Logging Functions XXXIII. Exif Functions XXXIV. Expect Functions XXXV. File Alteration Monitor Functions XXXVI. Forms Data Format Functions XXXVII. filePro Functions XXXVIII. ...
Error Handling and Logging Functions XXXII. Exif Functions XXXIII. File Alteration Monitor Functions XXXIV. filePro Functions XXXV. Filesystem 文件系统函数 XXXVI. Firebird/InterBase Functions XXXVII....
Error Handling and Logging Functions XXXII. Exif Functions XXXIII. File Alteration Monitor Functions XXXIV. filePro Functions XXXV. Filesystem 文件系统函数 XXXVI. Firebird/InterBase Functions XXXVII....
Error Handling and Logging Functions XXXII. Exif Functions XXXIII. File Alteration Monitor Functions XXXIV. filePro Functions XXXV. Filesystem 文件系统函数 XXXVI. Firebird/InterBase Functions XXXVII....
其他一些对数组或哈希表有用的函数包括sort(),next(),prev()和each()。 对象 使用new语句产生一个对象: class foo { function do_foo () { echo "Doing foo."; } } $bar = new foo; $bar->do_foo(); 改变变量...
如果你想要定义一个完整的自定义频道从而可以完全控制 Monolog 的实例化和配置,可以在配置文件 config/logging.php 中指定一个 custom 驱动类型。此外,你的配置中还要包含一个 via 项来指定被调用来创建 Monolog ...
模拟-最小PHP日志记录库版权:(c)2012-至今Johnny Broadway 执照:一个基于将闭包用于可配置性和可扩展性的思想的最小PHP日志记录程序包。 它起静态类的作用,但是您可以通过闭包函数(也称为)完全控制日志消息的...