diff --git a/plugins/nf-amazon/src/main/nextflow/cloud/aws/batch/AwsBatchExecutor.groovy b/plugins/nf-amazon/src/main/nextflow/cloud/aws/batch/AwsBatchExecutor.groovy index 9ed2923c92..1ce8875521 100644 --- a/plugins/nf-amazon/src/main/nextflow/cloud/aws/batch/AwsBatchExecutor.groovy +++ b/plugins/nf-amazon/src/main/nextflow/cloud/aws/batch/AwsBatchExecutor.groovy @@ -299,7 +299,7 @@ class AwsBatchExecutor extends Executor implements ExtensionPoint, TaskArrayExec String getJobOutputStream(String jobId) { try { - return helper.getTaskLogStream(jobId) + return helper.getTaskLogStream(jobId, awsOptions.getLogsGroup()) } catch (ResourceNotFoundException e) { log.debug "Unable to find AWS Cloudwatch logs for Batch Job id=$jobId - ${e.message}" diff --git a/plugins/nf-amazon/src/main/nextflow/cloud/aws/batch/AwsBatchHelper.groovy b/plugins/nf-amazon/src/main/nextflow/cloud/aws/batch/AwsBatchHelper.groovy index fc1056d4df..0e5672ce57 100644 --- a/plugins/nf-amazon/src/main/nextflow/cloud/aws/batch/AwsBatchHelper.groovy +++ b/plugins/nf-amazon/src/main/nextflow/cloud/aws/batch/AwsBatchHelper.groovy @@ -198,7 +198,7 @@ class AwsBatchHelper { * The Batch jobs as a string value or {@code null} if no logs is available. Note, if the log * is made of multiple *page* this method returns only the first one */ - String getTaskLogStream(String jobId) { + String getTaskLogStream(String jobId, String groupName) { final streamId = getLogStreamId(jobId) if( !streamId ) { log.debug "Unable to find CloudWatch log stream for batch job id=$jobId" @@ -206,7 +206,7 @@ class AwsBatchHelper { } final logRequest = new GetLogEventsRequest() - .withLogGroupName("/aws/batch/job") + .withLogGroupName(groupName ?: "/aws/batch/job") .withLogStreamName(streamId) final result = new StringBuilder()