Repository navigation
v0.9.0
The logger no longer goes quiet when things get bad. A long session used to spend its
50-log budget by mid-morning and send nothing after, a flood of one error hid everything
behind it, and an entry past 100 KiB arrived as broken text. Now the budget refills and
keeps a fifth for errors, repeats are counted and sent as a summary — on the next visit
if the tab closed first — and a big entry is shortened with its full copy in Storage.
Each was checked live, and the live checks found two bugs the unit tests had passed.
Changed
- The client's log budget refills, keeps an error reserve, and turns repeats into summaries instead of dropping them (#40). The budget was 50 logs per page load, cleared on
beforeunload, with every severity spending from the same pool and every duplicate past 3 copies simply dropped. Now: the budget refills atrefillPerMinute(default 1/min) and survives a reload insessionStorage—beforeunloadno longer resets it; the lasterrorReserveshare (default 20%) can only be spent byERRORand above, by rank (SEVERITY_ORDER), soCRITICAL,ALERTandEMERGENCY— new severities, see below — may spend it too; and afterduplicateLimitfull copies, further occurrences are counted rather than dropped and sent as oneWARNINGsummary — hourly, when the tab is hidden, and once at startup for anything a previous visit left queued — carryingrepeatOf,repeatCount,firstSeen,lastSeen, andappId/releaseId/userId/screen/errorTyperecovered from the signature itself rather than a second stored copy of them. The browser has no serverlogIdfor the first copy, sorepeatOfinstead points at a client-sidelabels.repeatKeythat every full copy carries. The per-signature map is capped at 200 entries (evicting the oldest with nothing pending first) so a flood of distinct messages cannot grow it without bound. Unsent summaries wait inlocalStorage(survives the tab closing), capped atmaxPendingSummaries, expired aftersummaryMaxAgeDays, markedsentLate="true"when a later visit sends them, and removed from the queue only once their send has actually succeeded — a failed send (offline, or the tab closing right after) leaves it queued for the next flush or visit to retry, never twice. All seven numbers are configurable viarateLimitOptions. The three console messages a dropped or counted log produces changed to match. See README, "Volume controls". writeLog's production branch honours a client-suppliedtimestamp, but only on a repeat summary.LogPayloadgains an optionaltimestamp; it is written into the entry only whenlabels.repeatCountis present and the value is within the last 8 days and no more than 5 minutes in the future — so a summary is timestamped atlastSeen, not at send time, and anything else keeps Cloud Logging's own ingestion time.
Fixed
- An entry over 100 KiB arrived broken, with no severity or labels. Cloud Functions and Cloud Run both cut a stdout/stderr log line at exactly 102,400 bytes — measured live.
writeLog's production branch now measures the finished entry and, past 90 KiB, shortens it (breadcrumb data, then other context, then the tail of a long stack, then long text fields, then oversized label values —severity, labels, trace andserviceContextare never touched) before writing, saves the full original to Cloud Storage asfsl-overflow.jsonwhen a bucket is available, and labels the entrytruncated="true"(issue #21).
Documentation
/query-logscounts repeats. The shipped skill now addsrepeatCountfrom the summaries to the full copies when asked how often something happened, and readsfsl-overflow.jsonfor a shortened entry. The README's Querying table gains thetruncated,repeatKey/repeatOfandsentLatefilters.- The server half has to run on Google Cloud. 0.8.0's README said "any Node server". Entries go to stdout, which reaches Cloud Logging only on Cloud Functions, Cloud Run, GKE, App Engine, or Compute Engine with the Ops Agent — elsewhere they print and go nowhere.