In our Wordpress site, users occasionally encounter the error page "Error Establishing Database Connection".
As this happens quite seldom there's no general problem with the Wordpress DB configuration.
I'd like to find out under which circumstances the error occurs (e.g. some misconfigured plugin, database connection pool reaching max. connections, ...).
Therefore I enabled Wordpress debugging like so:
define('WP_DEBUG', true);
define('WP_DEBUG_LOG', true);
define('WP_DEBUG_DISPLAY', false);
My problem is: the database error isn't reported in any log, not in Wordpress' debug.log and not in the php_error.log (I can reproduce the error in my staging site but nothing shows up in the log).
Question: is there any way to make the error show up in the Wordpress debug.log? Ideally with a stack trace?