Search in sources :

Example 1 with LogWatcher

use of org.eclipse.che.workspace.infrastructure.kubernetes.namespace.log.LogWatcher in project che-server by eclipse-che.

the class KubernetesDeployments method watchLogs.

/**
 * Start watching the logs of this deployment.
 *
 * @param handler is processing log messages
 * @param podNames pods of interest for watching the logs
 */
public synchronized void watchLogs(PodLogHandler handler, RuntimeEventsPublisher eventsPublisher, LogWatchTimeouts timeouts, Set<String> podNames, long limitInputStreamBytes) throws InfrastructureException {
    if (logWatcher == null) {
        LOG.debug("start watching logs of pods '{}' of  workspace '{}'", podNames, workspaceId);
        logWatcher = new LogWatcher(clientFactory, eventsPublisher, workspaceId, namespace, podNames, executor, timeouts, limitInputStreamBytes);
        logWatcher.addLogHandler(handler);
        watchEvents(logWatcher);
    } else {
        LOG.debug("Already watching logs of workspace [{}], just adding log handler", workspaceId);
        logWatcher.addLogHandler(handler);
    }
}
Also used : LogWatcher(org.eclipse.che.workspace.infrastructure.kubernetes.namespace.log.LogWatcher)

Example 2 with LogWatcher

use of org.eclipse.che.workspace.infrastructure.kubernetes.namespace.log.LogWatcher in project devspaces-images by redhat-developer.

the class KubernetesDeployments method watchLogs.

/**
 * Start watching the logs of this deployment.
 *
 * @param handler is processing log messages
 * @param podNames pods of interest for watching the logs
 */
public synchronized void watchLogs(PodLogHandler handler, RuntimeEventsPublisher eventsPublisher, LogWatchTimeouts timeouts, Set<String> podNames, long limitInputStreamBytes) throws InfrastructureException {
    if (logWatcher == null) {
        LOG.debug("start watching logs of pods '{}' of  workspace '{}'", podNames, workspaceId);
        logWatcher = new LogWatcher(clientFactory, eventsPublisher, workspaceId, namespace, podNames, executor, timeouts, limitInputStreamBytes);
        logWatcher.addLogHandler(handler);
        watchEvents(logWatcher);
    } else {
        LOG.debug("Already watching logs of workspace [{}], just adding log handler", workspaceId);
        logWatcher.addLogHandler(handler);
    }
}
Also used : LogWatcher(org.eclipse.che.workspace.infrastructure.kubernetes.namespace.log.LogWatcher)

Aggregations

LogWatcher (org.eclipse.che.workspace.infrastructure.kubernetes.namespace.log.LogWatcher)2