use logging.exception instead of logging.error to capture stacktrace