Expand description
app.logs.tail: the last lines of this AgentMux’s own srv or host log (spec §4.3), a read.
Token shapes, private keys and card or ID numbers are hidden line by line, and the answer
carries no path: only the lines and when the file was last written.
Structs§
- Filter 🔒
- What a caller wants out of the lines read: a minimum level and a text a line must contain. Both must hold.
Enums§
- Level 🔒
- A log line’s level, lowest first.
Constants§
- DEFAULT_
LINES 🔒 - FILTERED_
READ_ 🔒BYTES - With a level or a text asked for, more of the file is searched, since the lines wanted may be far back among noise. A bound on the work, and the answer says how much was searched.
- KEY_
BEGIN 🔒 - KEY_END 🔒
- MAX_
CONTAINS 🔒 - The longest text a line can be asked to contain.
- MAX_
LINES 🔒 - MAX_
TEXT_ 🔒BYTES - A cap on the text of one answer; the oldest lines go first.
- READ_
BYTES 🔒 - How much of the end of a file is read: enough for
MAX_LINESlong lines, and a bound on the work.
Functions§
- fit 🔒
- Keeps the newest lines whose text fits
maxbytes; says whether any were left out. - handle_
local_ 🔒logs GET /api/v1/app/logs?log=srv|host&lines=N&level=warn&contains=store: the same read for this machine’s own agents (container agents too: it goes through srv, no host file access is given out).- level_
of 🔒 - The level a log line carries: the logs are JSON lines with
"level":"INFO"near the start. A line that has none (a wrapped continuation, text from a child process) has no level. - logs_
tail 🔒 - newest_
log 🔒 - The most recently written log file in
dirwhose name starts withprefix. - parse_
level 🔒 levelas a caller names it.- pick 🔒
- The last
nof the lines that passfilter, and how many passed. The filter comes first, then the cut: so “the last 100 warnings that mention store” is the last 100 of the warnings, not the warnings among the last 100. - prefix_
of 🔒 - The log file name prefix of
which. - read_
tail 🔒 - The last
windowbytes of the file, and whether that is only part of it. - tail 🔒
- The tail of this machine’s srv or host log, for
app.logs.tailand forGET /api/v1/app/logs. Lines are read, masked, filtered, cut to the lastlines, and fitted to the answer’s size, in that order. The answer says how many lines passed the filter (matched), out of how many were searched (searched). - window_
lines 🔒 - Every whole line of
bytes, masked. The whole text is masked before it is split, so a private key whose BEGIN and END lines are many lines apart is hidden as one block. Whenfrom_middlethe first line is a fragment of a longer one and is dropped. - without_
open_ 🔒key textread from the middle of a file may start inside a private key: its BEGIN line is before the window, so the key’s body lines would not match the key mask. When an END marker comes before any BEGIN marker, everything up to the end of that line is dropped.