.withStdOut(true) .withFollowStream(true) .withTailAll() .exec(loggingCallback) .awaitStarted();
Tail(DockerClient docker, Container container, Logger logger) { Preconditions.checkNotNull(container,"Container must not be null"); this.logger = logger; this.logContainerCmd = docker.logContainerCmd(container.getId()) .withStdErr(true) .withStdOut(true) .withTailAll(); }
public void copyLog(String containerId, boolean follow, boolean stdout, boolean stderr, boolean timestamps, int tail, OutputStream outputStream) throws IOException { this.readWriteLock.readLock().lock(); try { LogContainerCmd logContainerCmd = dockerClient.logContainerCmd(containerId).withStdErr(false).withStdOut(false); logContainerCmd.withFollowStream(follow); logContainerCmd.withStdOut(stdout); logContainerCmd.withStdErr(stderr); logContainerCmd.withTimestamps(timestamps); if (tail < 0) { logContainerCmd.withTailAll(); } else { logContainerCmd.withTail(tail); } OutputStreamLogsResultCallback outputStreamLogsResultCallback = new OutputStreamLogsResultCallback(outputStream); logContainerCmd.exec(outputStreamLogsResultCallback); try { outputStreamLogsResultCallback.awaitCompletion(); } catch (InterruptedException e) { throw new IOException(e); } } finally { this.readWriteLock.readLock().unlock(); } }
public void copyLog(String containerId, boolean follow, boolean stdout, boolean stderr, boolean timestamps, int tail, OutputStream outputStream) throws IOException { this.readWriteLock.readLock().lock(); try { LogContainerCmd logContainerCmd = dockerClient.logContainerCmd(containerId).withStdErr(false).withStdOut(false); logContainerCmd.withFollowStream(follow); logContainerCmd.withStdOut(stdout); logContainerCmd.withStdErr(stderr); logContainerCmd.withTimestamps(timestamps); if (tail < 0) { logContainerCmd.withTailAll(); } else { logContainerCmd.withTail(tail); } OutputStreamLogsResultCallback outputStreamLogsResultCallback = new OutputStreamLogsResultCallback(outputStream); logContainerCmd.exec(outputStreamLogsResultCallback); try { outputStreamLogsResultCallback.awaitCompletion(); } catch (InterruptedException e) { throw new IOException(e); } } finally { this.readWriteLock.readLock().unlock(); } }
.withStdErr(Boolean.TRUE) .withStdOut(Boolean.TRUE) .withTailAll();
.withStdErr(true) .withStdOut(true) .withTailAll() .withFollowStream(true);
logContainerCmd.withTailAll();
.withStdOut(true) .withTimestamps(true) .withTailAll() .withSince(since) .exec(loggingCallback);