MediaWiki fatal errors result in a Varnish-generated error page which contains something like this:
If you report this error to the Wikimedia System Administrators, please include the details below. Request from 18.104.22.168 via cp1053 cp1053, Varnish XID 831980440 Error: 503, Backend fetch failed at Sat, 16 Sep 2017 16:28:16 GMT
Unfortunately these details are mostly useless to developers as Logstash does not log the XID. AIUI Varnish adds it to the backend request as well so there is not technical reason it couldn't be done.