Answers for "php function to write error to log manually"

PHP
1

php set error log file

ini_set("log_errors", 1); // Enable error logging
ini_set("error_log", "/tmp/php-error.log"); // set error path
error_log( "Hello, errors!" ); // log a test error
Posted by: Guest on July-31-2021
0

php error log

// Php Error Log
error_log("Error message");

// Log and Array
error_log( print_r( [
  __METHOD__,
  'error_key_1' => 'error_value'
] ) );
Posted by: Guest on August-10-2021

Browse Popular Code Answers by Language