You can use logger.exception for that