Log when requests create unhandled exceptions

Haven't been able to test this directly, but I've been running around in circles dealing with an exception message my client was printing with no context or message. As the server has 0 logging, I couldn't access the stack trace. Can something like this be added so any request the generates an unhandled exception gets optionally logged?