I have searched this for hours but haven't found working solution yet.
I have this setting in my php.ini
error_log = error_log
It should make separate error_log file in every folder if I'm right ?
But it does not. I also have this in the beginning of my script :
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
ini_set('error_log', 'error_log');
error_reporting(E_ALL);
Still all my errors are logged in /var/log/apache2/error_log
How to make it to log errors in each folder where script is running ?
I'm running Ubuntu 1.04 with LAMP stack installed. php version is 7.2
Thank you in advance
You can set relative paths with something like...
error_log = ../logs/error_log_name
So if your index.php file is in /var/www/mysite/public/index.php then the log file will be in /var/www/mysite/logs/error_log_name
I found the problem. It was permission issue, I forgot to do chown and chmod for this folder. Thank you all.