Skip to content

how to monitor logging

Bryan edited this page Jun 13, 2026 · 1 revision

Logging

The daemon logs local request events as structured JSON. Logging helpers live in src/lode/observability.py, and daemon calls happen in record_request() in src/lode/daemon.py.

Log shape

log_event() in src/lode/observability.py writes JSON with an event, a numeric time, and caller-provided fields. Daemon requests use event name http_request and include request ID, method, path, and status.

Redaction

sanitize() in src/lode/observability.py recursively redacts dictionary keys containing sensitive terms. Tests in tests/test_observability.py verify that redaction works for nested values.

How to add logs

Use log_event() instead of plain print() for daemon or background operations. Include concrete, non-secret fields such as repo_id, path, status, and request_id when useful.

Key source files

File Purpose
src/lode/observability.py Structured log and redaction helpers.
src/lode/daemon.py Request logging integration.
tests/test_observability.py Log and redaction tests.

Related pages

Clone this wiki locally