Russian Ukraine English
Catalog RSS


XVIII. Error Handling and Logging Functions

These are functions dealing with error handling and logging. They allow you to define your own error handling rules, as well as modify the way the errors can be logged. This allows you to change and enhance error reporting to suit your needs.

With the logging functions, you can send messages directly to other machines, to an email (or email to pager gateway!), to system logs, etc., so you can selectively log and monitor the most important parts of your applications and websites.

The error reporting functions allow you to customize what level and kind of error feedback is given, ranging from simple notices to customized functions returned during errors.

Table of Contents
error_log — send an error message somewhere
error_reporting — set which PHP errors are reported
restore_error_handler — Restores the previous error handler function
set_error_handler — Sets a user-defined error handler function.
trigger_error — Generates a user-level error/warning/notice message
user_error — Generates a user-level error/warning/notice message
Led