March 19, 2012
show message in log file with php
Question by JERC
I need to know how to show a message in the log in apache with php, I know that java has this instruction
System.out.println
and in tcl
ns_log notice
but there are some equivalent in php?
Thanks!!!
Answer by Starx
Use error_log() function to set custom error messages
error_log("Oracle database not available!", 0);
Or you can save the errors to custom log file as
error_log("Oops, something went wrong!", 3, "/var/tmp/my-errors.log");