I want to write a message to an error log file when executing PHP code.
I am trying to use the PHP error_log()
function Docs.
But it's not working properly for me.
If you don't want to change anything in your php.ini file, according to PHP documentation, you can do this.
error_log("Error message\n", 3, "/mypath/php.log");
The first parameter is the string to be sent to the log. The second parameter 3
means expect a file destination. The third parameter is the log file path.