Join Jon Peck for an in-depth discussion in this video Logging errors to file, part of Debugging PHP: Advanced Techniques.
- View Offline
There are a number of configuration options relating to logging errors, but only a couple …are really necessary for most scenarios.…Similar to error_reporting options, these options are set in php.ini …and can be overridden using ini set.…Log_errors, which defaults to off (0), to not log errors.…I'm going to set log_errors to on to log_errors.…Use of 0 and 1 will also work as values, which I'll need to use with ini set.…Log_errors_max_len is the length of the error messages stored …in the logs measured in bytes.…
The default is 1024 bytes.…If messages are getting truncated, I can either set it to a higher value …or set it to 0 for unlimited message length.…Error_log, which sets the name of the file where the script errors should be logged.…by default, it's Null and empty.…If log_errors is on and error log is null, errors will be sent to the Apache…error log from the Web server or standard error from a command line interface.…These three configuration options give me the ability to enable error_logging.…
This course covers installation of Xdebug on Apache as well as working with the NetBeans IDE (integrated development environment). Jon then introduces native web browser developer tools for Firefox and Chrome, and demonstrates browser independent web debugging tools. Best practices for debugging and profiling web application failures and performance issues are also covered.
- Configuring PHP error reporting
- Logging errors to file
- Gracefully handling fatal errors
- Installing Xdebug
- Understanding the principles of remote debugging
- Remote debugging with NetBeans
- Extending your browser with Firebug, FirePHP, or ChromePHP