32 Logs — recording what the application does
A database keeps activity logs about itself: queries, transactions, actions, tasks, and its metrics every second. You switch them on and off on the admin UI's Activity page. The Logs page is for logs of your own, about what the application does: the requests a site answers, the orders placed, the jobs run, the errors met.
You define a log as a list of columns, and the application records entries into it by the log's key:
db.CustomLogs.Record("orders", ("amount", 249.90), ("customer", "acme"), ("items", 3));The Logs page shows the entries as graphs over time, as a list, and as the spread of a column's values. A log needs no node type, transaction or index. It is an append-only record, cheap enough to write a million times a day.
- 32.1 Defining a log — You can define a log on the Logs page, in a definition file, or from code. On the Logs page, New log starts from a blank definition or from a template: web requests, business events, errors and warnings, positions, or…
- 32.2 Recording from the application — db.CustomLogs is the store's ICustomLogs. There are four ways to record, each one entry per call:
- 32.3 Statistics — Entries are the record; statistics are what the graphs are drawn from. They are aggregated as entries arrive and kept per second, minute, hour, day, week and month, so a graph of the last five minutes and one of the last…
- 32.4 Estimated unique counts: HyperLogLog — Counting different values, such as distinct users in an hour, cannot be done with a running total. An exact count must remember every value it has seen, so it grows with the data. The estimated unique count uses the…
- 32.5 Reading a log — Each log has a page under Logs, with the Record and Statistics switches at the top and five views. Graphs, Entries and Analyse share one time range: a range ending now (5 minutes to 12 months), two moments you type in…
- 32.6 Changing a definition — You can change a definition while the log has entries. Before it saves, the Logs page lists what the change does to what is recorded, for you to confirm. Nothing is lost that the list does not name.
- 32.7 Files, limits and cleaning up — A log keeps what it records in logs/<key>/ in the database's log storage, with the key in lower case: one entries file per minute, hour, day or month, such as log.requests.hour.2026-09-26-14.bin; a .txt copy of each…
- 32.8 Positions — A column can hold a position. Its type is Position (LogDataType.GeoCoordinate), the same GeoCoordinate the node store uses (§5). The Positions template starts a log with a position column, a text column naming what…