I know you can hide the errors and notifications with E^.
But I would like to have the errors be output into a log file.
Is there a way to have errors only display into a log file and not on the page?
Does anyone know the setting for this?
I know you can hide the errors and notifications with E^.
But I would like to have the errors be output into a log file.
Is there a way to have errors only display into a log file and not on the page?
Does anyone know the setting for this?
Rather than change the error reporting level, change display_errors to Off and log_errors to On in your php.ini
But I would like this for part of a framework as it is tedious to check error_logs on some servers.
I’m confused. I understand not wanting error messages to show, but you want them sent to a log file and at the same time log files are too troublesome to check? Maybe you would prefer sending them via email? But be warned, you could end up flooding your inbox real quick.
Are you asking tor the custom error log file?
Maybe set_error_handler can help you?
Just write a function that writes the errors of certain levels to a log, and ignore all others. Or --better-- write errors of a certain level to a log, and write all other errors to another log
http://www.php.net/manual/en/errorfunc.configuration.php
set error_reporting to desired level
set error_log
set log_errors
set display_errors
see ini_set()
Haha, well…
I wanted them to save an error log into the spot where the application is sitting, so it makes it very easy for people to find out if something went wrong. Since this is for a distributable framework and some people might not have access to error logs on their servers I’d like it to be very easy to find for everyone
I’m looking over these links now thank you
OK, now I understand. The error_log function http://nl3.php.net/manual/en/function.error-log.php takes optional arguments.
i.e. $type 3 and $destination ./where_ever/