WordPress debug handling with file system access

I’d like to log php errors and debug / warning messages from WordPress into the cloud console logging dashboard but it doesn’t look like the wp_debug documentation allows for a different error handler. Globally it looks like I could use the following snippet to re-route all php errors to a syslog function that would essentially get the error details piped into cloud console but it would be ideal to get all of the standard warning / notice spam that WordPress typically generates.

function exception_handler($exception) {
    syslog(LOG_ERROR, $exception->getMessage());
}
​
set_exception_handler('exception_handler');

Any help would be greatly appreciated!

Related posts

Leave a Reply