Most logging is optimised for the moment of writing. console.log(\user ${id} failed checkout: ${reason}`)` reads well and takes three seconds. Then, during an incident, you try to ask it something โ how many checkouts failed for insufficient funds, and for whom? โ and discover that every line is a unique string. You cannot count it, group it or filter it. You can only grep it and read.
Sentrinel's logs are built for the other moment: the one where you ask.
The message is stable, the values are fields
const log = getLogger(["payment", "checkout"]);
log.warn("Checkout rejected", { reason: "insufficient_funds", amount: 42 });
"Checkout rejected" is the same string every time, so it groups: the explorer can tell you it happened 3,112 times today and whether that is normal. reason and amount are fields, so you can filter by them โ click reason=insufficient_funds in any row and the view narrows to exactly those.
The same rule holds in every SDK. The Python SDKs store a log call's message uninterpolated: logger.info("card declined for %s", user) is stored as the template, with the arguments alongside, so every occurrence of one statement is one group no matter who it was about. extra={...} becomes structured attributes.
Context is attached once, where you have it
The function that rejects a checkout usually does not know which customer it is running for or which plan they are on. It should not have to.
withContext({ userId: user.id, tier: user.plan }, async () => {
await processOrder(); // every record inside carries both fields
});
Anything logged inside โ three calls down, in code that never heard of a user โ carries those fields. That is what makes high-cardinality filtering practical: warnings for enterprise customers in the payment subsystem is two clicks, not a regular expression.
Categories are hierarchical too. getLogger(["payment", "fraud"]) logs under payment.fraud, and filtering by payment selects the whole subsystem.
Every record knows where it came from
A log line written while serving a request carries that request's id, the trace, and the span it was written in, attached from the ambient context rather than passed by hand. So the two directions you actually need are both one click:
- From a log record, open the request it was written during โ method, path, status, latency, the user โ and the trace behind it.
- From a request, open its Logs tab: exactly what that request logged, in order.
And because the trace crosses services, every log in this trace pulls the records from every service that took part: the phone that made the call, the gateway it hit, the Python service behind that. The incident you are looking at stops being five tabs of timestamps you line up by eye.
The vocabulary of your own telemetry
Nobody remembers that checkout attaches tier and fraud attaches riskBand. The Fields panel lists every attribute key in play for the selected app, with its commonest values, each clickable as a filter. It is the difference between knowing what to search for and discovering it.
Levels are filters, not decoration
The level tiles at the top are counts and filters: click WARN to see warnings and above. minLevel in the SDK drops records before they are buffered, so a chatty debug line in production costs nothing if you have set the floor at info.
One more consequence of structured levels is worth knowing: with the Node plugin's console capture, a request that logged an error is never sampled out, even if it returned a 200. The requests where your code complained are the ones you want to keep, and sampling is for ordinary traffic.
What it is not
It is not a place to dump payloads. Attributes are bounded โ 64 fields, 2,000 characters each โ because the value is in many small queryable fields, not in an embedded document you then have to search through. If you find yourself logging a whole request body, turn on request-body capture for that route instead; it is masked, capped and attached to the request where it belongs.
Logs outside a request โ a startup line, a nightly job โ work too. They simply have no request to open, and they are filed under the app that wrote them.
Setup is one option in the plugin (logging: { minLevel: "info" }), one handler in Django or FastAPI (SentrinelLogHandler), or Sentrinel.log(...) on mobile. The reference for each is in the docs.