When reporting bugs or asking for help, logs are invaluable. However, logs often contain sensitive data that must be redacted before sharing.
Always remove or replace the following before pasting logs:
| Type | Example | Replace with |
|---|---|---|
| Auth tokens | Bearer eyJhbGciOi... |
Bearer [REDACTED] |
| API keys | sk_live_abc123... |
sk_live_[REDACTED] |
| Passwords | password=MySecret123 |
password=[REDACTED] |
| Private keys | SABC123... (Stellar) |
[REDACTED] |
| JWT tokens | eyJhbGciOiJIUzI1NiIs... |
[REDACTED_JWT] |
| Email addresses | user@example.com |
user@[REDACTED] |
| IP addresses | 192.168.1.100 |
[REDACTED_IP] |
| Database URIs | postgres://user:pass@host/db |
postgres://[REDACTED] |
Some information is safe and useful for debugging:
- Request IDs — these help correlate logs across services
- Timestamps — essential for understanding event ordering
- HTTP methods and paths —
GET /api/confessions/123is safe - Status codes —
500 Internal Server Erroris safe - Error messages — generic errors like
ECONNREFUSEDare safe - User IDs — UUIDs like
a1b2c3d4-...are safe (not personally identifiable)
Paste directly into the issue or PR comment inside a code block:
```
2026-05-30T10:15:23Z [Nest] INFO [HealthController] GET /api/health/live 200 2ms
2026-05-30T10:15:24Z [Nest] ERROR [ConfessionService] Failed to encrypt: ECONNREFUSED
```
Attach as a file or use a code block with a collapsible section:
<details>
<summary>Full backend logs (click to expand)</summary>
```
[paste redacted logs here]
```
</details>
If the issue is visual (UI bug, layout problem), attach screenshots directly to the GitHub comment. Drag and drop images into the comment box.
If you have raw log output, pipe it through this to auto-redact common patterns:
cat your-log-file.log | \
sed 's/Bearer [A-Za-z0-9._-]*/Bearer [REDACTED]/g' | \
sed 's/sk_live_[A-Za-z0-9]*/sk_live_[REDACTED]/g' | \
sed 's/[a-f0-9]\{64\}/[REDACTED_HEX]/g' | \
pbcopy # copies to clipboard on macOS## Bug: Confession creation fails with 500
**Steps to reproduce:**
1. POST /api/confessions with valid body
2. Returns 500 instead of 201
**Logs:**2026-05-30T10:15:23Z [Nest] ERROR [ConfessionService] create() failed Request ID: req_abc123 Error: ECONNREFUSED 127.0.0.1:5432 Stack: at TypeORMConnection.connect (...)
**Expected:** 201 Created
**Actual:** 500 Internal Server Error
This gives maintainers everything they need without exposing secrets.