use of org.eclipse.che.workspace.infrastructure.kubernetes.namespace.log.PodLogToEventPublisher in project che-server by eclipse-che.
the class KubernetesInternalRuntime method watchLogsIfDebugEnabled.
private void watchLogsIfDebugEnabled(Map<String, String> startOptions) throws InfrastructureException {
if (LogWatcher.shouldWatchLogs(startOptions)) {
LOG.info("Debug workspace startup. Will watch the logs of '{}'", getContext().getIdentity().getWorkspaceId());
// get all the pods we care about
Set<String> podNames = machines.getMachines(getContext().getIdentity()).values().stream().filter(Objects::nonNull).map(KubernetesMachineImpl::getPodName).filter(Objects::nonNull).collect(Collectors.toSet());
LOG.debug("Watch '{}' pods in workspace '{}'", podNames, getContext().getIdentity().getWorkspaceId());
namespace.deployments().watchLogs(new PodLogToEventPublisher(this.eventPublisher, this.getContext().getIdentity()), this.eventPublisher, LogWatchTimeouts.DEFAULT, podNames, LogWatcher.getLogLimitBytes(startOptions));
}
}
use of org.eclipse.che.workspace.infrastructure.kubernetes.namespace.log.PodLogToEventPublisher in project devspaces-images by redhat-developer.
the class DeployBroker method watchLogsIfDebugEnabled.
private void watchLogsIfDebugEnabled(Map<String, String> startOptions, Pod pluginBrokerPod) throws InfrastructureException {
if (LogWatcher.shouldWatchLogs(startOptions)) {
LOG.debug("Will watch the logs of plugin broker of workspace '{}'", runtimeId.getWorkspaceId());
namespace.deployments().watchLogs(new PodLogToEventPublisher(runtimeEventsPublisher, runtimeId), runtimeEventsPublisher, LogWatchTimeouts.AGGRESSIVE, ImmutableSet.of(pluginBrokerPod.getMetadata().getName()), LogWatcher.getLogLimitBytes(startOptions));
}
}
use of org.eclipse.che.workspace.infrastructure.kubernetes.namespace.log.PodLogToEventPublisher in project che-server by eclipse-che.
the class DeployBroker method watchLogsIfDebugEnabled.
private void watchLogsIfDebugEnabled(Map<String, String> startOptions, Pod pluginBrokerPod) throws InfrastructureException {
if (LogWatcher.shouldWatchLogs(startOptions)) {
LOG.debug("Will watch the logs of plugin broker of workspace '{}'", runtimeId.getWorkspaceId());
namespace.deployments().watchLogs(new PodLogToEventPublisher(runtimeEventsPublisher, runtimeId), runtimeEventsPublisher, LogWatchTimeouts.AGGRESSIVE, ImmutableSet.of(pluginBrokerPod.getMetadata().getName()), LogWatcher.getLogLimitBytes(startOptions));
}
}
use of org.eclipse.che.workspace.infrastructure.kubernetes.namespace.log.PodLogToEventPublisher in project devspaces-images by redhat-developer.
the class KubernetesInternalRuntime method watchLogsIfDebugEnabled.
private void watchLogsIfDebugEnabled(Map<String, String> startOptions) throws InfrastructureException {
if (LogWatcher.shouldWatchLogs(startOptions)) {
LOG.info("Debug workspace startup. Will watch the logs of '{}'", getContext().getIdentity().getWorkspaceId());
// get all the pods we care about
Set<String> podNames = machines.getMachines(getContext().getIdentity()).values().stream().filter(Objects::nonNull).map(KubernetesMachineImpl::getPodName).filter(Objects::nonNull).collect(Collectors.toSet());
LOG.debug("Watch '{}' pods in workspace '{}'", podNames, getContext().getIdentity().getWorkspaceId());
namespace.deployments().watchLogs(new PodLogToEventPublisher(this.eventPublisher, this.getContext().getIdentity()), this.eventPublisher, LogWatchTimeouts.DEFAULT, podNames, LogWatcher.getLogLimitBytes(startOptions));
}
}
Aggregations