From 6bf99653043233ae0dd2c46ae05f5d268132e9e6 Mon Sep 17 00:00:00 2001 From: mcmero <7799828+mcmero@users.noreply.github.com> Date: Fri, 24 May 2024 15:22:21 +1000 Subject: [PATCH] Save report and trace Logging as previously configured will not work with WEHI stornext read-only changes, so using Nextflow execution reports for data provenance instead. --- logger.config | 19 ------------------- nextflow.config | 10 ++++++++++ 2 files changed, 10 insertions(+), 19 deletions(-) delete mode 100644 logger.config diff --git a/logger.config b/logger.config deleted file mode 100644 index d1d8a3b..0000000 --- a/logger.config +++ /dev/null @@ -1,19 +0,0 @@ -process.afterScript = { - logMainDir = "${params.outdir}/log" - logMainDir = workflow.launchDir.resolve(logMainDir).toString() - - // Build log directory path based on task name - logSubDir = task.name.replace(" (null)", "").replace(" ", "/").replaceAll(" ", "_").replaceAll("[()]", "") - logDir = logMainDir + "/" + logSubDir - - // Define command to copy log files - cpLogCmd = "mkdir -p ${logDir}; cp -a nxf_log.tar.gz ${logDir}; " - - // Assemble final command - cmd = "ls -alR > .command.ls; " - cmd += "mkdir nxf_log; " - cmd += "for file in .command.*; do cp -a \${file} nxf_log/\${file#.}.txt; done; " - cmd += "tar -czf nxf_log.tar.gz nxf_log;" - cmd += cpLogCmd - cmd -} \ No newline at end of file diff --git a/nextflow.config b/nextflow.config index 496653f..98786d0 100644 --- a/nextflow.config +++ b/nextflow.config @@ -103,3 +103,13 @@ profiles { includeConfig 'logger.config' } } + +def trace_timestamp = new java.util.Date().format( 'yyyy-MM-dd_HH-mm-ss') +report { + enabled = true + file = "${params.outdir}/log/execution_report_${trace_timestamp}.html" +} +trace { + enabled = true + file = "${params.outdir}/log/execution_trace_${trace_timestamp}.txt" +}