What I would do is to catch errors using this then log my custom error using this
More information from PHP error_reporting
-
30-07-2022 - |
سؤال
I have automated my error_reporting
process. Errors are logged to a file and periodically sent via email.
Problem is I don't get enough information. E.g. I can see a undefined index notice; but I can't see where it was triggered as often its an included file.
Is it possible to get a dump of $_SERVER
in the error log?
المحلول
نصائح أخرى
You can use function debug_backtrace
Function return backtrace for current position.
For Include $_SERVER
to email you can use print_r($_SERVER, true);
but I think this can help you little.
لا تنتمي إلى StackOverflow