--- name: inspect-shz-logs description: Inspect and follow the SHZ backend's local and production logs through bounded, read-only commands. Use when Codex is working in the shz-backend project and needs to diagnose startup failures, exceptions, request behavior, scheduled jobs, or runtime incidents from local backend.log or the production backend, error, info, and user logs on the shz server. --- # Inspect SHZ Logs Use the bundled script instead of assembling SSH commands manually. Keep every initial read bounded; follow logs only when the user explicitly asks to monitor live activity. ## Inspect local logs Read the last 200 lines: ```bash .codex/skills/inspect-shz-logs/scripts/view.sh local 200 ``` Follow the local log interactively: ```bash .codex/skills/inspect-shz-logs/scripts/view.sh local 200 --follow ``` ## Inspect production logs Read the main application log: ```bash .codex/skills/inspect-shz-logs/scripts/view.sh online backend 200 ``` Read the current error log: ```bash .codex/skills/inspect-shz-logs/scripts/view.sh online error 200 ``` Choose only one production log type: `backend`, `error`, `info`, or `user`. Add `--follow` as the final argument only for an explicit live-monitoring request. For keyword analysis, fetch a bounded window and filter locally, for example: ```bash .codex/skills/inspect-shz-logs/scripts/view.sh online error 1000 | rg -i 'exception|error|failed' ``` ## Diagnose from logs 1. Establish whether the request concerns local or production behavior. 2. Read 100–300 recent lines from the relevant log. 3. Expand up to the script's 5,000-line cap only when timestamps or stack traces require more context. 4. Correlate timestamps, thread names, exception causes, and nearby requests. 5. Report the evidence and likely cause without exposing tokens, passwords, personal data, or unrelated log content. Treat production access as read-only. Never restart services, edit files, deploy code, truncate logs, or run arbitrary remote commands through this skill. Read [references/log-locations.md](references/log-locations.md) only when checking server identity, paths, or supported log types.