Using
Reads the last N lines of a log file.
applies to v0.5.1GET
/store-api/logs
const url = 'https://example.com/store-api/logs';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://example.com/store-api/logs \ --header 'Authorization: Bearer <token>'Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Query Parameters
Section titled “Query Parameters”lines
integer
Tail line count from file end (default 100, capped at 1000). 0 is rejected.
q
string
Case-sensitive substring filter; only matching lines count toward lines.
file
string
Name of a file listed by GET /logs/files. Defaults to the newest luradb.log* file.
Responses
Section titled “Responses”Tail of the selected log file
Media typeapplication/json
object
file
required
Name of the file actually read, without a path.
string
format
required
Mirrors log.format (“json” | “text”) — the client parses lines itself.
string
lines
required
Chronologically ascending (oldest first), like tail.
Array<string>
truncated
required
true iff the scan budget was exhausted before lines matches and before file start.
boolean
Example generated
{ "file": "example", "format": "example", "lines": [ "example" ], "truncated": true}Lines = 0, or invalid file name
Media typetext/plain
string
File does not exist
Media typetext/plain
string
Log directory unreadable, no luradb.log* file found, or read failed
Media typetext/plain
string
Log HTTP access is disabled
Media typetext/plain
string