make wordpress log errors in apache log file

I use a separate error-log-file for WordPress that i add to wp-config.php like this:

Step 1: Create a log file

Create an empty file called “php-errors.log”. This file will serve as your site’s PHP error log. Your server will need write access to this file, so make sure to set the appropriate permissions.

Step 2: Add the magic code

Add this to wp-config.php after That's all, stop editing! Happy blogging.

// log php errors
@ini_set('log_errors','On'); // enable or disable php error logging (use 'On' or 'Off')
@ini_set('display_errors','Off'); // enable or disable public display of errors (use 'On' or 'Off')
@ini_set('error_log','/home/path/logs/php-errors.log'); // path to server-writable log file

Once in place, edit the third line with the absolute directory path to the php-errors.log file created in the first step. Upload to your server and call it done. All PHP errors will now be logged to your php-errors.log file, thereby enabling you to monitor and resolve errors as quickly as possible.

This trick is from diggwp. and there you can read more about solutions to handle errors in WordPress.