mirror of
https://github.com/Ed1s0nZ/CyberStrikeAI.git
synced 2026-09-15 22:25:33 +02:00
feat: persist diagnostic logs with daily rotation and retention
This commit is contained in:
@@ -143,3 +143,9 @@ After changing, validate the specific subsystem rather than trusting the save me
|
||||
- Config API and apply: `internal/handler/config.go`
|
||||
- Route registration: `internal/app/app.go`
|
||||
- C2 reconciliation: `internal/app/c2_lifecycle.go`
|
||||
|
||||
## Diagnostic logs
|
||||
|
||||
Alongside `log.output` (controlled by `log.level`), warnings and errors are saved as JSON Lines in `log/diagnostic-YYYY-MM-DD.log`, using the server’s local date. This independent warn-and-above output preserves existing context, caller information, and error stack traces; ordinary info/debug records are excluded and no extra request bodies or tool output are collected.
|
||||
|
||||
Configure `log.diagnostic_dir` (default `log`, relative to the working directory), `log.diagnostic_retention_days` (default 14, including today; nonpositive values use the default), or `log.diagnostic_disabled: true` to disable it. Restart after changing these settings. Files are created only when a diagnostic record is written; the first write each day removes expired files matching `diagnostic-YYYY-MM-DD.log`. Cleanup does not run while no diagnostic records are written. Write failures are reported to stderr without interrupting the primary log output.
|
||||
|
||||
Reference in New Issue
Block a user