Logging3:54 with Alena Holligan
Displaying errors to the screen during development is just the first step. The developer won't always run across every possible error and what about errors that happen in production? That’s where logging comes in.
Settings for Your PHP File
Open logging.php. At the top of the file we have some log options using the ini_set function:
ini_set("log_errors", 1); ini_set("error_log", "php-error.txt");
Settings for an .htaccess File
# log errors php_value log_errors 1 # log file for errors php_value error_log php-error.txt
Settings for the php.ini File
Replace the following path with the full path your log file.
log_errors = On error_log = "/Applications/MAMP/htdocs/php-error.txt"
You need to sign up for Treehouse in order to download course files.Sign up