Class DockerLogsContainer
java.lang.Object
org.gradle.api.internal.AbstractTask
org.gradle.api.DefaultTask
com.bmuschko.gradle.docker.tasks.AbstractDockerRemoteApiTask
com.bmuschko.gradle.docker.tasks.container.DockerExistingContainer
com.bmuschko.gradle.docker.tasks.container.DockerLogsContainer
- All Implemented Interfaces:
Comparable<Task>
,org.gradle.api.internal.DynamicObjectAware
,org.gradle.api.internal.TaskInternal
,ExtensionAware
,Task
,Configurable<Task>
Copies the container logs into standard out/err, the same as the `docker logs` command. The container output
to standard out will go to standard out, and standard err to standard err.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.gradle.api.Task
Task.Namer
-
Field Summary
Fields inherited from interface org.gradle.api.Task
TASK_ACTION, TASK_CONSTRUCTOR_ARGS, TASK_DEPENDS_ON, TASK_DESCRIPTION, TASK_GROUP, TASK_NAME, TASK_OVERWRITE, TASK_TYPE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionSet to true to follow the output, which will cause this task to block until the container exists.protected Date
Set to the true to include a timestamp for each line in the output.getSince()
Limit the output to lines on or after the specified date.getSink()
Sink to write log output into.Include standard err.Include standard out.Set to true to copy all output since the container has started.Limit the number of lines of existing output.void
logAndProcessResponse
(com.github.dockerjava.api.DockerClient dockerClient) void
Methods inherited from class com.bmuschko.gradle.docker.tasks.container.DockerExistingContainer
getContainerId, targetContainerId, targetContainerId, targetContainerId
Methods inherited from class com.bmuschko.gradle.docker.tasks.AbstractDockerRemoteApiTask
getApiVersion, getCertPath, getDockerClient, getDockerClientService, getNextHandler, getRegistryAuthLocator, getUrl, onComplete, onError, onNext, start
Methods inherited from class org.gradle.api.DefaultTask
compareTo, configure, dependsOn, doFirst, doFirst, doFirst, doLast, doLast, doLast, finalizedBy, getActions, getAnt, getDependsOn, getDescription, getDestroyables, getDidWork, getEnabled, getExtensions, getFinalizedBy, getGroup, getInputs, getLocalState, getLogger, getLogging, getMustRunAfter, getName, getOutputs, getPath, getProject, getShouldRunAfter, getState, getTaskDependencies, getTemporaryDir, getTimeout, hasProperty, mustRunAfter, onlyIf, onlyIf, property, setActions, setDependsOn, setDescription, setDidWork, setEnabled, setFinalizedBy, setGroup, setMustRunAfter, setOnlyIf, setOnlyIf, setProperty, setShouldRunAfter, shouldRunAfter, usesService
Methods inherited from class org.gradle.api.internal.AbstractTask
appendParallelSafeAction, doNotTrackState, getAsDynamicObject, getConvention, getIdentityPath, getImpliesSubProjects, getLifecycleDependencies, getOnlyIf, getReasonNotToTrackState, getReasonTaskIsIncompatibleWithConfigurationCache, getRequiredServices, getServices, getSharedResources, getStandardOutputCapture, getTaskActions, getTaskIdentity, getTemporaryDirFactory, hasTaskActions, injectIntoNewInstance, isCompatibleWithConfigurationCache, isEnabled, isHasCustomActions, notCompatibleWithConfigurationCache, prependParallelSafeAction, setImpliesSubProjects
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.gradle.api.Task
doNotTrackState, getConvention, notCompatibleWithConfigurationCache
-
Constructor Details
-
DockerLogsContainer
public DockerLogsContainer()
-
-
Method Details
-
getFollow
Set to true to follow the output, which will cause this task to block until the container exists. Default is unspecified (docker defaults to false). -
getTailAll
Set to true to copy all output since the container has started. For long running containers or containers with a lot of output this could take a long time. This cannot be set if #tailCount is also set. Setting to false leaves the decision of how many lines to copy to docker. Default is unspecified (docker defaults to true). -
getTailCount
Limit the number of lines of existing output. This cannot be set if #tailAll is also set. Default is unspecified (docker defaults to all lines). -
getStdOut
Include standard out. Default is true. -
getStdErr
Include standard err. Default is true. -
getShowTimestamps
Set to the true to include a timestamp for each line in the output. Default is unspecified (docker defaults to false). -
getSince
Limit the output to lines on or after the specified date. Default is unspecified (docker defaults to all lines). -
getSink
Sink to write log output into. -
getInternalSince
-
runRemoteCommand
- Specified by:
runRemoteCommand
in classAbstractDockerRemoteApiTask
- Throws:
InterruptedException
-
logAndProcessResponse
public void logAndProcessResponse(com.github.dockerjava.api.DockerClient dockerClient) throws InterruptedException - Throws:
InterruptedException
-