Skip to main content

Module logs

Module logs 

Source
Expand description

The worker’s log endpoint (see archive/PROJECT.md, Task logs): the webserver reads task logs from the worker that ran them, a part at a time.

  • GET /logs/{attempt_id}?from=<byte>&limit=<bytes> answers the log’s bytes from from (at most limit, between 4 bytes and 1 MiB), with headers saying which worker answered (Schedr-Worker-Id), how long the log is now (Schedr-Log-Size) and whether the attempt still runs here (Schedr-Attempt-Running, from the journal, checked before the file is read: an attempt said to be finished has all its output in the answer’s size). Reading on from the size returned follows a running task’s log.
  • Errors are JSON ({"error": "…"}): 400 for an ID that isn’t an attempt ID, 404 for a log this worker doesn’t have (deleted by retention, or another worker’s).

Access is decided by TLS (tls.mode = "app": only clients with a certificate from the CA) or by the mesh; the endpoint serves logs only, never actions.

Structs§

LogEndpoint
What the endpoint serves.
LogError
An error answer.
LogQuery
The query of a log request.

Functions§

is_attempt_id
Whether text looks like an attempt ID (a UUID): nothing else names a log file here.
router
The endpoint’s routes.