I would like to know is there any way to catch all PHP errors (not only WP Errors) in Wordpress without modifying core?
The reason I am asking is that I would like to manually catch all errors and use third party software as an error aggregator, for example Sentry, but not limited to. for example email them or log to database. I know Wordpress can log errors to file in DEBUG mode but this is not what I am looking for, because it's to simple and limiting.
And yes - I want to catch Wordpress core errors, if there are any. Not only plugin/theme related.
[edit]
This is requirement made by my client - they want me to be able to monitor all PHP related errors in any application they have, not only Wordpress. WP log file is not enough for them, beceause the want to be able to aggregate all their applications (including WP) errors in one place, index them, generate support tickets etc.*
Basically if I could push all errors through Monolog, that'll be perfect. Monolog is not requirement, but it is easy to implement, that's all.
[edit]
I have already tried this gist, but it is limited to only DB operations.
Also I've tried (just for educational reasons) to add error handler (Monolog) in main WP index.php file and it works, but I can't figure out how to make WP push all it's errors through it. I know it's wrong to edit an of core files (not upgrade safe etc.), that's why I'm asking if there is any other way.*
Thanks in advance!