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
.txtcopy of each, when text copies are on; - the statistics,
log.requests.statistics.bin, with a.bkupof the previous save.
The activity logs use the same layout (logs/query/, logs/system/, …). The critical error log is
logs/critical.error.txt.
While the database is open, a cleanup runs about once a minute. It saves the statistics, deletes files older than the age limit, and deletes the oldest files when the log is over its size limit. It always deletes whole files, never the one being written. Delete older entries on the Data view also works by whole files.
Deleting a log asks what goes with it. The definition only leaves the entries and statistics on
disk, and a new log with the same key picks them up. The definition and everything it recorded
deletes them too. In code, this is db.CustomLogs.Delete(key, deleteRecorded).
The Logs page works while the database is closed: you can define and change logs, read entries and record test entries. The application records only through an open store.
Two things to know:
- A value that does not convert is left out silently. A column that stays empty in the Entries view usually gets values of the wrong kind, such as text in a number column.
- Made-up entries mix with real ones. You cannot delete them alone: they go only with the entries of their time.
Activity logs work the same way, but the database defines them. A switch on the Activity page
takes effect at once, and lasts across a restart only when you click Save and remember changes.
That saves it in the LogRecording setting (§12.1), in
relatude.db.overrides.json. The Built-in logs switch on the Logs page adds a read-only tab for
each activity log, with the Graphs, Entries and Analyse views.