Expand description
Structured logging for every app built from the Framework: a level, a
target (a board id, http, app), a message and named fields. Records
go to a rotating JSON Lines file under the state directory and to an
in-memory ring buffer the log viewer reads. Every message and field value
passes through redact first, so a token or an Authorization header
never reaches a file.
Code builds its handle with Logger::new, a board with its id as the
target. Before init runs, records
stay in the buffer, so tests never touch the file system.
Structs§
- Config
- Where and how much to log.
- Logger
- A handle that writes records for one target.
- Record
- One log line.
Enums§
- Level
- How much a record matters, most important first.
Constants§
- BUFFER_
RECORDS - How many records the ring buffer keeps for the viewer.
- LEVEL_
ENV - The environment variable that overrides the stored level at startup.
Functions§
- default_
directory <state dir>/subspace/logs, the default log directory.- directory
- The directory the log file is in, once
initran. - init
- Opens the log file and starts writing records to it.
SUBSPACE_LOGin the environment overridesconfig.level. - level
- The level records must reach to be kept.
- path
- The actual live path of the installed file writer, not a default location.
- recent
- The buffered records, oldest first.
- recent_
after - The buffered records after sequence
seq, oldest first. - redact
textwith every credential it holds masked.- set_
level