public function captureException($exception, $options = array(), $logger = '', $context = null)
    {
        if (!$this->isEnvironmentEnabled()) {
            return null;
        }
        $this->processOptions($options);
        try {
            $eventId = $this->_client->getIdent(
                $this->_client->captureException($exception, $options, $logger, $context)
            );
        } catch (Exception $e) {
            if (YII_DEBUG) {
                throw new CException('SentryClient failed to log exception: ' . $e->getMessage(), (int)$e->getCode());
            } else {
                $this->log($e->getMessage(), CLogger::LEVEL_ERROR);
                throw new CException('SentryClient failed to log exception.', (int)$e->getCode());
            }
        }
        $this->_loggedEventIds[] = $eventId;
        $this->log(sprintf('Exception logged to Sentry with event id: %d', $eventId), CLogger::LEVEL_INFO);
        return $eventId;
    }