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>
public class DockerLogsContainer extends DockerExistingContainer
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
Constructors Constructor Description DockerLogsContainer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Property<Boolean>
getFollow()
Set to true to follow the output, which will cause this task to block until the container exists.protected Date
getInternalSince()
Property<Boolean>
getShowTimestamps()
Set to the true to include a timestamp for each line in the output.Property<Date>
getSince()
Limit the output to lines on or after the specified date.RegularFileProperty
getSink()
Sink to write log output into.Property<Boolean>
getStdErr()
Include standard err.Property<Boolean>
getStdOut()
Include standard out.Property<Boolean>
getTailAll()
Set to true to copy all output since the container has started.Property<Integer>
getTailCount()
Limit the number of lines of existing output.void
logAndProcessResponse(com.github.dockerjava.api.DockerClient dockerClient)
void
runRemoteCommand()
-
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
-
-
-
-
Method Detail
-
getFollow
@Input @Optional public final Property<Boolean> 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
@Input @Optional public final Property<Boolean> 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
@Input @Optional public final Property<Integer> 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
@Input @Optional public final Property<Boolean> getStdOut()
Include standard out. Default is true.
-
getStdErr
@Input @Optional public final Property<Boolean> getStdErr()
Include standard err. Default is true.
-
getShowTimestamps
@Input @Optional public final Property<Boolean> getShowTimestamps()
Set to the true to include a timestamp for each line in the output. Default is unspecified (docker defaults to false).
-
getSince
@Input @Optional public final Property<Date> getSince()
Limit the output to lines on or after the specified date. Default is unspecified (docker defaults to all lines).
-
getSink
@OutputFile @Optional public RegularFileProperty getSink()
Sink to write log output into.
-
runRemoteCommand
public void runRemoteCommand() throws InterruptedException
- Specified by:
runRemoteCommand
in classAbstractDockerRemoteApiTask
- Throws:
InterruptedException
-
logAndProcessResponse
public void logAndProcessResponse(com.github.dockerjava.api.DockerClient dockerClient) throws InterruptedException
- Throws:
InterruptedException
-
-