You can create an error handling module, which will catch all errors not caught by your applications. This module will be a drag-and-drop assembly (DLL) that will have to be loaded in the <httpModules>
section of each site or server's configuration.
You can for example let the handler log the error somehow (per application, per server or towards one global log[service]), get an ID out of that log entry and redirect to either a page shared for all websites or a generic error handling form that each of your applications will have to contain. Upon showing this page you are free of the somewhat limited environment of the handler (as it is a new request), and can do anything you want with the log ID used in the redirect URL.