Search
 
SCRIPT & CODE EXAMPLE
 

PHP

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
Comment

php error log

ini_set("log_errors", 1); // Enable error logging
ini_set("error_log", "/tmp/php-error.log"); // set error path
Comment

ubuntu php error log

cat /var/log/php7.4-fpm.log
#change php version
Comment

how to see php error log

/usr/local/apache/logs/error_log
Comment

php error log

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

// Log and Array
error_log( print_r( [
  __METHOD__,
  'error_key_1' => 'error_value'
] ) );
Comment

php custom error log

// You can easily create your own function to handle logging, like so:

/***
	Simple function to log a value to a text file
    Takes 1 parameter: the value to log to the file, as a STRING
***/
function log_data($value)
{
	define('LOG_FILE_PATH', 'form-data-log.txt'); // define the path to the file that you would like to have created (if it does not yet exist)
	$time_stamp = date("Y-m-d H:i:s"); // get the current time
	$file_pointer = fopen(LOG_FILE_PATH, 'a'); // open the log file (in 'append' mode)
  	fwrite($file_pointer, $time_stamp . " ---> " . $value . "
"); // log the value to the file
  	fclose($data_log); // ALWAYS remember to close the log file after writing to it!
}
Comment

PREVIOUS NEXT
Code Example
Php :: PHP Display Posts by Category in WordPress 
Php :: laravel wheredate 
Php :: codeigniter installation with composer 
Php :: php check version 
Php :: pluck laravel 
Php :: wp_login_form wrong password redirect 
Php :: how to delete empty rows in phpmyadmin 
Php :: docker : from php alpine 
Php :: php var_dump more readable 
Php :: php insert array into mysql table 
Php :: magento 2 db connection 
Php :: laravel make model along with its controller and migration file 
Php :: wordpress admin url 
Php :: php using composer autoload - own code 
Php :: how to remove duplicate values from a multidimensional array in php 
Php :: adding data dynamically to empty array in php 
Php :: php array get value at index 
Php :: laravel blade check if request url matches 
Php :: db transaction laravel 
Php :: git pull using php 
Php :: laravel routes not working on production server 
Php :: move_uploaded_file 
Php :: get recoed between two datetime laravel 
Php :: showing from to in larvel pagination 
Php :: destroy multiple sessions in laravel 
Php :: laravel validation not equal to 
Php :: PHP MySQL Use The WHERE Clause 
Php :: return with success message laravel 
Php :: The media must not be greater than 12288 kilobytes in laravel 
Php :: laravel trans with parameters 
ADD CONTENT
Topic
Content
Source link
Name
9+5 =