Skip to content

Querying & retention

Logs in CAOS are specified as ordinary objects, and that single decision is what would determine how they are read, secured, reported, retained and purged: the same way every other object is, with no bespoke log console carrying its own permission model, query language or retention rules. This page describes what the object model would buy and where logging-specific policy still applies.

Two things on this page are specified and not built, and both are marked where they start. Reading is one: the log objects are absent from the describe layer, and a log is served by the logs noun instead, with three verbs. Retention is the other, and it splits rather than failing whole — the policy is the Engine’s and is enforced, and an audit row cannot be hard-deleted at all, but nothing performs the hot → archived transition and there is no purge sweep.

A Log or Log Entry is specified to be read through the platform query surface, the same entry point used for any record, so that log reads are automatically narrowed by the caller’s access with no post-filtering and no bypass:

  • Field-level security narrows the columns a reader sees. A Log Entry field a user cannot read is absent from their result, not blanked — the same FLS-at-read guarantee the audit streams make. A structured field carrying data the reader may not see does not leak through the log.
  • Record-level access narrows the rows. A reader sees the Logs their access permits; an unreadable Log is absent, which (per the error taxonomy’s not-found-beats-forbidden rule) does not disclose its existence.
  • Elevated reads are declared and audited. A diagnostics tool that must read across all Logs uses the query surface’s elevated mode, which requires a declared capability and emits its own audit entry — reading logs broadly is itself a logged, governed act.

Access to logs is gated by the same diagnostics permissions as the execution trace, so the developer-log stream sits inside the existing catalog rather than inventing new grants:

Capability Grants
diagnostics.view Read Logs and Log Entries (own scope, then widening by grant) — the everyday “open the log for this transaction”
diagnostics.decode Read the sensitive raw detail attached to a failure entry — the same grant that decodes an internal error’s raw text
diagnostics.trace Raise verbose capture for a scope + window (see capture)

Because these are the existing diagnostics grants, an org does not administer a separate logging permission surface.

What reporting would give for free, once logs are objects

Section titled “What reporting would give for free, once logs are objects”

Every row below is a consequence of the object model, so none of it is available while the log objects are absent from the describe layer. It is kept because it is the argument for making them objects, and because it is the list somebody should check the day they do. Read it as the payoff, not as the present tense.

  • List views with saved filters — “my ERROR logs today”, “rolled-back saves in invoice-recalc this week”.
  • Record pages — open a Log to see its entries in execution order, its budget snapshot, its phase runs, and its correlation id as a pivot to the audit streams.
  • Reports and dashboards — error rate by scenario, budget consumption trends, top participants by WARN count — built with the normal report builder, not a logging-specific analytics tool.
  • The query surface — ad-hoc analysis and export as plain reads, because anything the UI shows would be a query.

What exists in place of the last one is narrower than it, and the gap is worth being precise about rather than waving at: the logs noun has three verbs — logs/list, logs/app and logs/volume — and a caller writes against those routes rather than against data query. logs/app is the closest thing to ad-hoc analysis, and it is a feed read with whatever filters that handler accepts. There is still no single-record open and no log export beside them; the export that does exist belongs to the execution trace, which is a different stream. So the gap this list describes has narrowed and has not closed: three purpose-built reads are not a query surface, and nothing here composes, joins or aggregates the way data query would.

The argument this list makes is the one the whole design turns on, so it is worth stating plainly rather than quietly: Nebula must ship a “Logger Console” app, custom list views, a “Related Log Entries” component and quick actions because Log__c is an app object that does not come with those. CAOS avoids that only if logs are ordinary objects. They are not yet, so today the comparison does not land, and a Logger package would have to ship components of its own for the same reason Nebula’s does. See vs Nebula Logger and the Logger app, both of which now say so.

A Log’s correlationId is the join key across the three audit streams. From an open Log a reader pivots to: the execution trace of the same transaction, the data history it wrote, and the metadata audit of any config change that governed it — and back from an error to the Log via the same id. This is the “walk one failure end to end” promise made navigable, and it is only possible because the correlation id is now threaded end to end.

Log volume is real, so retention is specified as a per-tenant / per-plan policy, aligned with the retention model the audit surface already defines. The governing rules:

  • A retention date per Log. Each Log carries a retentionDate, defaulted from the tenant policy (and overridable per scenario — a noisy sync path can retain for days while an error log retains for months). This is Nebula’s LogRetentionDate__c idea, kept.
  • Hot, then archived — never a silent cliff. Within the hot window Logs are fully queryable; past it they are specified to roll to archive storage, not be hard-deleted. The not-hard-deleted half is enforced in the database; the rolling is the part nothing performs yet. Reaching past the hot window is reported as out-of-window with the archived range offered, never as “no results” — the same honesty rule the audit surface applies.
  • Purge is specified as a scheduled job with a floor, and the job does not exist. The design is that a retention job deletes Logs whose retentionDate has passed, on a schedule, using the platform background-work framework — the CAOS equivalent of Nebula’s LogBatchPurger + LogBatchPurgeScheduler — and that setting a Log’s retentionDate to null pins it indefinitely (kept from Nebula). No such job is scheduled in the Engine today. The only purge the scheduler runs is for a deleted org, which is a different mechanism answering a different question.
  • Level drives default retention. An ERROR Log outlives a TRACE Log by default, so the expensive-to-keep, low-value entries age out first and the diagnostically valuable ones persist — retention is level- and scenario-aware, not one flat number.

Almost everything is inherited, but a few rules are logging’s own:

  • Retention defaults by level and scenario, above.
  • A self-logging cap. The logging path must not itself become an unbounded producer — a runaway loop emitting millions of entries is bounded by the same budget envelope as any effect, so a save cannot log itself out of its resource budget. Logging counts against the transaction’s budget like any other effect work.
  • Masking at write time — sensitive structured fields are redacted before persistence, so archived logs never hold data that later access-narrowing would have hidden.