# Error Handling and Logging

# Introduction

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.

- Installing/Configuring
  - Runtime Configuration
- Predefined Constants
- Examples
- Error Handling Functions
  - debug_backtrace — Generates a backtrace
  - debug_print_backtrace — Prints a backtrace
  - error_clear_last — Clear the most recent error
  - error_get_last — Get the last occurred error
  - error_log — Send an error message to the defined error handling routines
  - error_reporting — Sets which PHP errors are reported
  - get_error_handler — Gets the user-defined error handler function
  - get_exception_handler — Gets the user-defined exception handler function
  - restore_error_handler — Restores the previous error handler function
  - restore_exception_handler — Restores the previously defined exception handler function
  - set_error_handler — Sets a user-defined error handler function
  - set_exception_handler — Sets a user-defined exception handler function
  - trigger_error — Generates a user-level error/warning/notice message
  - user_error — Alias of trigger_error

`↑` and `↓` to navigate • `Enter` to select • `Esc` to close • `/` to open