PHP offers simple but effective solution to log all errors to a log fiie.On all production web server you must turn off displaying error to end users via a web browser. Remember PHP gives out lots of information about path, database schema and all other sort of sensitive information. You are strongly advised to use error logging in place of error displaying on production web sites. The idea is quite simple -only developer should see php error log.
how can we do?
Simple, create a text file name which names “error-log.txt” in your website directory. Add the following php code to your common php file or particular file.
Then execute your script in the web browser. If you have any errors in the script it will automatically fetched into the error log file.
ini_set(“log_errors” , “1″);
ini_set(“error_log” , “Errors.log.txt”);
ini_set(“display_errors” , “0″);
Hope this will help you!