Skip to content

Add structured rotating logging for the daemon#3

Merged
Egge21M merged 2 commits into
masterfrom
logging
Mar 14, 2026
Merged

Add structured rotating logging for the daemon#3
Egge21M merged 2 commits into
masterfrom
logging

Conversation

@Egge21M
Copy link
Copy Markdown
Owner

@Egge21M Egge21M commented Mar 12, 2026

Summary

  • add a production-oriented daemon logger that writes structured JSON logs to ~/.cocod/daemon.log
  • rotate logs automatically with sane defaults and env-based overrides for path, level, size, and retention
  • route daemon lifecycle, request, and wallet-library logging through the same logger with sensitive field redaction

Details

This change makes daemon logging work reliably even when the CLI auto-spawns the daemon in detached mode. Instead of losing logs to ignored stdout/stderr, the daemon now writes to a dedicated log file in the cocod config directory.
It also adds:

  • request logging with method, path, status, duration, and request id
  • lifecycle logging for startup, shutdown, config load, and unexpected failures
  • log rotation with retention to avoid unbounded file growth
  • redaction for sensitive values such as passphrases, mnemonics, tokens, invoices, and payment request data
  • README updates describing the new logging defaults and configuration knobs

@Egge21M Egge21M merged commit 752be53 into master Mar 14, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant