Skip to content
Luna
Esc
↑↓navigate↵open⌘Jpreview

Tail logs

Returns the log lines written since a cursor, oldest first, and a new cursor. Call it again with that cursor to follow a tenant’s logs as they are written. The first call can pass the cursor of a log query, or none. The filters work as they do in a log query, apart from since and until.

GET/_luna/telemetry/{tenant}/logs/tail
Authorization
AuthorizationBearer token · headerrequired

An account key (la_…), an API key (lt_…) or a session token (ls_…). The scopes listed are the permissions the operation needs.

Scopes:logs:read
Path parameters
tenantstringrequired

The tenant, by its full name.

Query parameters
sinceinteger<int64>

Lines from this moment on, in milliseconds since the Unix epoch. One hour ago when left out.

min 0
untilinteger<int64>

Lines up to this moment, in milliseconds since the Unix epoch. Now when left out.

min 0
typestring

Only lines of this luna type.

keystring

Only lines of the luna with this key: the whole key as JSON, or the value of one of its fields.

callstring

Only lines of the call with this id.

tracestring

Only lines of the trace with this id.

levelstring

Only lines at this level or above: debug, info, warn or error.

qstring

Only lines that contain this text.

sourcestring

luna for the lines Luna writes about a luna, code for the lines your code writes.

eventstring

Only the lines Luna writes about these events, separated by commas, such as call,wake.

outcomestring

Only calls that ended this way: ok, error or timeout.

limitinteger

How many lines to return. 200 when left out, 5000 at most.

min 0
cursorstring

The cursor of the last answer. Only the tail reads it.

Responses
200

The lines since the cursor.

logsLogLine[]required
Show properties
Array of LogLine
seqstringrequired

The line's number on the server that kept it, as text.

memberinteger<int64>required

The server that kept the line.

min 0
tsMsinteger<int64>required

When the line was written, in milliseconds since the Unix epoch.

min 0
levelstringrequired

debug, info, warn or error.

bodystringrequired

The text of the line.

lunaTypestring | null

The luna type that wrote the line.

keystring | null

The key of the luna that wrote the line, as JSON text.

handlerstring | null

The handler that was running.

callIdstring | null

The id of the call that was running.

traceIdstring | null
spanIdstring | null
versioninteger<int64> | null

The version of the code that was running.

min 0
sourcestring | null

luna for a line Luna wrote about the luna. Left out for a line your code wrote.

eventstring | null

What a line of Luna's tells of, such as call or wake.

attrsobject | null

Further fields of the line.

cursorstringrequired

Where these lines end. Pass it to the tail as cursor to read what comes after.

default

The request failed. The status says how and error.message says why.

errorErrorDetailrequired
Show properties
codestring | null

A code for programs to branch on, when the error has one.

messagestringrequired

What went wrong, in a sentence a person can read.

Try it
Server
Authorization
Parameters
Request
curl -X GET 'https://luna.example.com/_luna/telemetry/string/logs/tail' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Accept: application/json'
Response
{
  "logs": [
    {
      "seq": "string",
      "member": 0,
      "tsMs": 0,
      "level": "string",
      "body": "string",
      "lunaType": "string",
      "key": "string",
      "handler": "string",
      "callId": "string",
      "traceId": "string",
      "spanId": "string",
      "version": 0,
      "source": "string",
      "event": "string",
      "attrs": {}
    }
  ],
  "cursor": "string"
}

Was this page helpful?