private List<HttpURL> getLogServerUris(ApplicationId applicationId, Optional<DomainName> hostname) {
        // Allow to get logs from a given hostname if the application is under the hosted-vespa tenant.
        // We make no validation that the hostname is actually allocated to the given application since
        // most applications under hosted-vespa are not known to the model, and it's OK for a user to get
        // logs for any host if they are authorized for the hosted-vespa tenant.
        if (hostname.isPresent() && HOSTED_VESPA_TENANT.equals(applicationId.tenant())) {
            int port = List.of(InfrastructureApplication.CONFIG_SERVER.id(), InfrastructureApplication.CONTROLLER.id()).contains(applicationId) ? 19071 : 8080;
            return List.of(HttpURL.create(Scheme.http, hostname.get(), port).withPath(HttpURL.Path.parse("logs")));
        }

        ApplicationVersions applicationVersions = getActiveApplicationVersions(applicationId)
                .orElseThrow(() -> new NotFoundException("Unable to get logs for for " + applicationId + " (application not found)"));
        List<Pair<String, Integer>> hostInfo = logserverHostInfo(applicationVersions);
        return hostInfo.stream()
                .map(h -> HttpURL.create(Scheme.http, DomainName.of(h.getFirst()), h.getSecond(), HttpURL.Path.parse("logs")))
                .toList();
    }
Gets the active Session for the given application id.

@return the active session, or null if there is no active session for the given application id.
configserver/src/main/java/com/yahoo/vespa/config/server/ApplicationRepository.java