public function log($level, $message, array $context = []) {

        if ( $this->config('requiredScope') && ( empty($context['scope']) ) )
            return false;

        $scopes = ( empty($context['scope']) ) ? [null] : $context['scope'];
        unset($context['scope']);
        $this->_context = $context;

        $Table = TableRegistry::get($this->config('model'), ['table' => $this->config('table')]);

        foreach ( $scopes as $scope ) {
            $entity = $Table->newEntity();

            $data = [
                'level'   => $level,
                'user_id' => $this->_userId(),
                'scope'   => $scope,
                'message' => $message,
                'context' => $this->_context,
            ];

            $entity = $Table->patchEntity($entity, $data);

            $Table->save($entity);
        }

        return true;
    }