20260914 强制 TOML 配置并完善 TA 刷新与 daemon
Some checks failed
ci / rust (push) Has been cancelled
ci / docker (push) Has been cancelled
ci / audit (push) Has been cancelled

This commit is contained in:
2026-09-14 16:58:08 +08:00
parent 6383e2c12c
commit 4975128945
48 changed files with 2795 additions and 1459 deletions

View File

@@ -1,12 +1,15 @@
# Diagnostic logging
For every field, default, constraint and complete example, see the [TOML configuration reference](configuration.md)。
The validator writes diagnostics to stderr. Under daemon, that stream is saved
as `runs/run_XXXXXX/validator.log`; it contains all enabled levels, not only errors.
`process-output.txt` captures ordinary output and is normally empty. The daemon's
own lifecycle diagnostics remain in the container log. No duplicate log forwarding
is performed. Historical `stderr.log` files are not renamed.
CLI and both daemon Compose files default to `info` and `text`.
TOML defaults and the shipped Compose TOML examples use `info` and `text`.
Compose does not independently select the logging format.
Text is written for people, with independently authored English sentences for
run lifecycle, validation stages, progress, output files and failures. It does not
enumerate event fields or translate event identifiers into prose. Progress reports
@@ -23,8 +26,8 @@ not select the format. Text is not a stable machine-parsing interface.
2026-09-11T10:45:36Z INFO [run 230] Validation completed in 82.0 seconds.
```
Use `--log-format json` or `PANDA_RPKI_LOG_FORMAT=json` for machine consumers;
the JSON event names and fields are unchanged. Both formats redact sensitive data.
Set `log-format = "json"` in the TOML for machine consumers; the JSON event
names and fields are unchanged. Both formats redact sensitive data.
Text error reasons are limited to 240 Unicode characters with an explicit notice
when shortened. Unknown extension/debug events retain a diagnostic identifier and
their message, not an arbitrary field dump. Use JSON (and debug/trace as needed)
@@ -79,8 +82,8 @@ unregistered literal call sites. Unknown library-supplied names default to debug
## Progress and volume
`--log-progress-interval-secs` overrides `PANDA_RPKI_LOG_PROGRESS_INTERVAL_SECS`,
default `10`. `0` suppresses periodic events, not stage events. `off/error/warn`
`log-progress-interval-secs` is configured in TOML and defaults to `10`. `0`
suppresses periodic events, not stage events. `off/error/warn`
do not create a progress thread. Queue snapshots are refreshed at most every 250ms.
`statistics_age_ms` is the age of the queue/PP snapshot, not the repository event
counters. `progress_stalled` means no observed completion for 30s, not proof of deadlock.
@@ -122,3 +125,13 @@ The `jq` examples require JSON logging to have been explicitly enabled.
Retention removes completed run directories including their logs. Archive needed
runs before the configured retention window expires. Summary history is append-only.
## Change an existing daemon to text
Set `log-format = "text"` at the TOML top level, before `[[anchors]]`.
Keep `log-level = "info"` or the desired existing level. Do not use the removed
`--log-format` flag or `PANDA_RPKI_LOG_FORMAT` environment override.
TOML is read at process start, so stop and recreate the service as described in
[Docker configuration reload](docker.md#graceful-stop-edit-and-reload).
Each new validator child inherits the controller configuration; prior run logs
and JSON summary/metadata files are not converted.