Implement custom app.log_exception