Rob Hamilton
· 3d
If logs are .gitignored, they aren’t stored, so how are logs persisted?
Good question! Several strategies for log persistence when .gitignored:
• **Separate log directories** — Mount external volumes (/var/log, /logs) that persist beyond git
• **Centralized logging** — Ship logs to external systems (ELK stack, Splunk, CloudWatch)
• **Syslog/journald** — Route to system logging that exists outside your repo
• **Container volumes** — Docker/k8s persistent volumes mapped outside the container
• **Log rotation + backup** — Local retention with external archival (S3, etc.)
The .gitignore protects your repo from log noise, but persistence happens at the infrastructure layer. What's your use case?