Skip to content

Commit 151dc58

Browse files
Merge pull request #608 from cylc/8.1.x
8.1.x
2 parents 039be07 + 456748c commit 151dc58

File tree

2 files changed

+40
-2
lines changed

2 files changed

+40
-2
lines changed

src/tutorial/furthertopics/message-triggers.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,11 @@ In order to get our workflow to trigger messages, we need to:
5151

5252
* Refer to these messages in the ``[dependencies]`` section of our workflow.
5353

54+
.. note::
55+
56+
The message will be recorded in the workflow's scheduler log.
57+
See :ref:`scheduler logs.cylc message` for details of how messages appear.
58+
5459
These outputs are then triggered during the running of the task.
5560
We can use these to manage tasks dependent on partially completed tasks.
5661

src/user-guide/running-workflows/scheduler-log-files.rst

Lines changed: 35 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,44 @@ The information logged here includes:
2424

2525
Workflow log files are primarily intended for human eyes. If you need
2626
to have an external system to monitor workflow events automatically, use:
27-
27+
2828
* Event hooks (see :cylc:conf:`flow.cylc[scheduler][events]` and
2929
:cylc:conf:`flow.cylc[runtime][<namespace>][events]`).
3030
* The GraphQL interface (can be accessed via GraphiQL in the Cylc GUI).
3131
* The sqlite *workflow run database*
3232
(see :ref:`Workflow Run Databases`)
33-
33+
3434
Rather than parse the log files.
35+
36+
37+
.. _scheduler Logs.Cylc message:
38+
39+
Cylc Message
40+
^^^^^^^^^^^^
41+
42+
The Scheduler Log also records messages sent by ``cylc message`` allowing you
43+
to add custom messages to this log.
44+
45+
For example, if your task contained the following code:
46+
47+
.. code-block:: shell
48+
49+
cylc message -- "ERROR:some_function failed."
50+
51+
Your log should produce output similar to:
52+
53+
.. code-block:: none
54+
55+
ERROR - [21491012T0410Z/mytask running job:01 flows:1] (received)some_function failed ERROR at 2023-04-14T11:36:35+01:00
56+
57+
Severity levels are the same as those used by
58+
`Python's logger <https://docs.python.org/3/library/logging.html#logging-levels>`_:
59+
60+
- CRITICAL
61+
- ERROR
62+
- WARNING
63+
- INFO
64+
- DEBUG
65+
66+
Messages logged at "DEBUG" will only appear in the scheduler log if the
67+
workflow is played with ``cylc play --debug``.

0 commit comments

Comments
 (0)