Logging stacktraces of exceptions