public static function hydrate(stdClass $log)
    {
        $hydrated = new LogEntity();

        if (isset($log->id)) {
            $hydrated->setId($log->id);
        }

        if (isset($log->text)) {
            $hydrated->setText($log->text);
        }

        if (isset($log->level)) {
            $hydrated->setLevel($log->level);
        }

        if (isset($log->channel)) {
            $hydrated->setChannel($log->channel);
        }

        if (isset($log->request_uri)) {
            $hydrated->setRequestUri($log->request_uri);
        }

        if (isset($log->request_method)) {
            $hydrated->setRequestMethod($log->request_method);
        }

        if (isset($log->ip)) {
            $hydrated->setIp($log->ip);
        }

        if (isset($log->created_by)) {
            $hydrated->setCreatedBy(UserHydrator::hydrate($log->created_by));
        }

        if (isset($log->email)) {
            $hydrated->setEmail($log->email);
        }

        if (isset($log->organization)) {
            $hydrated->setOrganization(OrgHydrator::hydrate($log->organization));
        }

        if (isset($log->organization_name)) {
            $hydrated->setOrganizationName($log->organization_name);
        }

        if (isset($log->context)) {
            $hydrated->setContext($log->context);
        }

        if (isset($log->created_at)) {
            $hydrated->setCreatedAt(new DateTime($log->created_at));
        }

        if (isset($log->user_agent)) {
            $hydrated->setUserAgent($log->user_agent);
        }

        return $hydrated;
    }