feat: persist logs across deploys, prune dangling images#50
Merged
Conversation
Each deploy recreates the vault-mcp container, destroying the previous container's log stream. Add a file sink extension to the logger that writes date-stamped log files (vault-mcp-YYYY-MM-DD.log) to /data/logs on the existing persistent volume. Files are pruned after 30 days (configurable via LOG_RETENTION_DAYS). Also add `docker image prune -f` to both deploy paths to prevent dangling images from accumulating (was consuming ~10 GB on the Lightsail instance). - Logger file sink uses the existing extensions mechanism — child loggers inherit it automatically - Luxon DateTime replaces all native Date usage in logger.ts - Add Luxon convention to AGENTS.md code style section - 9 new tests for file sink, date rollover, and retention pruning Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Rename `raw` → `envValue`, `parsed` → `retentionDays`, `match` → `logFileMatch`, `ext` → `extension` per naming convention. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
LOG_DIR is hardcoded in docker-compose.yml, not user-configurable via .env. Remove the misleading "Default: unset" comment. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Replace all `new Date()` arithmetic with Luxon — `DateTime.now().toISODate()`,
`.minus({ days: N })`, `.toISO()`. Consistent with the convention.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
vault-mcp-YYYY-MM-DD.log) to/data/logson the existing persistent volume. Logs now survive container recreation during deploys. 30-day retention with automatic pruning on startup (LOG_RETENTION_DAYSconfigurable).docker image prune -fadded to both deploy paths (CI workflow + local dev script). Reclaimed ~9.3 GB of dangling images on Lightsail from accumulated deploys (25 stale vault-mcp images).DateTimeover nativeDateto AGENTS.md code style. Migrated allDateusage inlogger.tsto Luxon.Test plan
Settings.now, startup pruning, retention window, custom retention, non-matching file safety)/data/logs/vault-mcp-YYYY-MM-DD.logexists on the instance and persists across a subsequent deploydocker image prune -fruns in CI deploy logs🤖 Generated with Claude Code