public function captureMessage($message, $params = array(), $options = array(), $stack = false, $context = null)
    {
        if (strlen($message) > self::MAX_MESSAGE_LENGTH) {
            throw new CException(sprintf(
                'SentryClient cannot send messages that contain more than %d characters.',
                self::MAX_MESSAGE_LENGTH
            ));
        }
        if (!$this->isEnvironmentEnabled()) {
            return null;
        }
        $this->processOptions($options);
        try {
            $eventId = $this->_client->getIdent(
                $this->_client->captureMessage($message, $params, $options, $stack, $context)
            );
        } catch (Exception $e) {
            if (YII_DEBUG) {
                throw new CException('SentryClient failed to log message: ' . $e->getMessage(), (int)$e->getCode());
            } else {
                $this->log($e->getMessage(), CLogger::LEVEL_ERROR);
                throw new CException('SentryClient failed to log message.', (int)$e->getCode());
            }
        }
        $this->_loggedEventIds[] = $eventId;
        $this->log(sprintf('Message logged to Sentry with event id: %d', $eventId), CLogger::LEVEL_INFO);
        return $eventId;
    }