|
4 | 4 | Tracing & visualisation |
5 | 5 | *********************** |
6 | 6 |
|
| 7 | + |
| 8 | +.. _execution-log: |
| 9 | + |
| 10 | +Execution log |
| 11 | +============= |
| 12 | + |
| 13 | +The ``nextflow log`` command shows information about executed pipelines in the current folder:: |
| 14 | + |
| 15 | + nextflow log <run name> [options] |
| 16 | + |
| 17 | +.. note:: Both the :ref:`execution report <execution-report>` and the :ref:`trace report <trace-report>` must be specified when the pipeline is first called. By contrast, the ``log`` option is useful after a pipeline has already run and is available for every executed pipeline. |
| 18 | + |
| 19 | +By default, ``log`` prints the list of executed pipelines:: |
| 20 | + |
| 21 | + $ nextflow log |
| 22 | + TIMESTAMP RUN NAME SESSION ID COMMAND |
| 23 | + 2016-08-01 11:44:51 grave_poincare 18cbe2d3-d1b7-4030-8df4-ae6c42abaa9c nextflow run hello |
| 24 | + 2016-08-01 11:44:55 small_goldstine 18cbe2d3-d1b7-4030-8df4-ae6c42abaa9c nextflow run hello -resume |
| 25 | + 2016-08-01 11:45:09 goofy_kilby 0a1f1589-bd0e-4cfc-b688-34a03810735e nextflow run rnatoy -with-docker |
| 26 | + |
| 27 | +Specifying a run name or session id prints tasks executed by that pipeline run:: |
| 28 | + |
| 29 | + $ nextflow log goofy_kilby |
| 30 | + /Users/../work/0b/be0d1c4b6fd6c778d509caa3565b64 |
| 31 | + /Users/../work/ec/3100e79e21c28a12ec2204304c1081 |
| 32 | + /Users/../work/7d/eb4d4471d04cec3c69523aab599fd4 |
| 33 | + /Users/../work/8f/d5a26b17b40374d37338ccfe967a30 |
| 34 | + /Users/../work/94/dfdfb63d5816c9c65889ae34511b32 |
| 35 | + |
| 36 | + |
| 37 | +Customizing fields |
| 38 | +------------------ |
| 39 | + |
| 40 | +By default, only the task execution paths are printed. A custom list of fields to print can be provided via the ``-f`` (``-fields``) option. For example:: |
| 41 | + |
| 42 | + $ nextflow log goofy_kilby -f hash,name,exit,status |
| 43 | + 0b/be0d1c buildIndex (ggal_1_48850000_49020000.Ggal71.500bpflank) 0 COMPLETED |
| 44 | + ec/3100e7 mapping (ggal_gut) 0 COMPLETED |
| 45 | + 7d/eb4d44 mapping (ggal_liver) 0 COMPLETED |
| 46 | + 8f/d5a26b makeTranscript (ggal_liver) 0 COMPLETED |
| 47 | + 94/dfdfb6 makeTranscript (ggal_gut) 0 COMPLETED |
| 48 | + |
| 49 | +The fields accepted by the ``-f`` options are the ones in the :ref:`trace report<trace-fields>`, as well as: script, stdout, stderr, env. List available fields using the ``-l`` (``-list-fields``) option. |
| 50 | + |
| 51 | +The ``script`` field is useful for examining script commands run in each task:: |
| 52 | + |
| 53 | + $ nextflow log goofy_kilby -f name,status,script |
| 54 | + align_genome COMPLETED |
| 55 | + bowtie --index /data/genome input.fastq > output |
| 56 | + ... |
| 57 | + |
| 58 | +Templates |
| 59 | +--------- |
| 60 | + |
| 61 | +The ``-t`` option allows a template (string or file) to be specified. This makes it possible to create complex custom report in any text based format. For example you could save this markdown snippet to a file:: |
| 62 | + |
| 63 | + ## $name |
| 64 | + |
| 65 | + script: |
| 66 | + |
| 67 | + $script |
| 68 | + |
| 69 | + exist status: $exit |
| 70 | + task status: $status |
| 71 | + task folder: $folder |
| 72 | + |
| 73 | +Then, the following command will output a markdown file containing the script, exit status and folder of all executed tasks:: |
| 74 | + |
| 75 | + nextflow log goofy_kilby -t my-template.md > execution-report.md |
| 76 | + |
| 77 | + |
| 78 | +Filtering |
| 79 | +--------- |
| 80 | + |
| 81 | +The ``filter`` option makes it possible to select which entries to include in the log report. Any valid groovy boolean expression on the log fields can be used to define the filter condition. For example:: |
| 82 | + |
| 83 | + nextflow log goofy_kilby -filter 'name =~ /foo.*/ && status == "FAILED"' |
| 84 | + |
| 85 | +.. warning:: The ``log`` command replaces the deprecated ``history`` command. |
| 86 | + |
| 87 | + |
7 | 88 | .. _execution-report: |
8 | 89 |
|
9 | 90 | Execution report |
|
0 commit comments