'Override implementation to report all exceptions to sentry.
log_exception() is added in Tornado v3.1.'

def log_exception(self, typ, value, tb):

    rv = super(SentryMixin, self).log_exception(typ, value, tb)
    if (isinstance(value, WebHTTPError) and ((value.status_code < 500) or (value.status_code > 599))):
        return rv
    self.captureException(exc_info=(typ, value, tb))
    return rv
