-
Notifications
You must be signed in to change notification settings - Fork 0
EN Logging Troubleshooting
The active log file carries the local date and rotates at local midnight:
~/.copilot-relay/logs/copilot-relay.2026-07-25.log
Files older than logRetentionDays (default 3) are deleted automatically.
Follow today's log:
tail -f ~/.copilot-relay/logs/copilot-relay.$(date +%F).logSearch every retained day with the glob:
grep -n "request_id=" ~/.copilot-relay/logs/copilot-relay.*.logEvery entry is a single line, including error entries carrying full
request/response context — so grep returns the whole entry rather than a
fragment of it.
If you upgraded from before v0.2.3, an undated copilot-relay.log may still be
present. It is the old single log file; it ages out on its own and nothing writes
to it any more.
Only three levels are valid:
| Level | Use |
|---|---|
error |
Startup failures, request failures, token refresh failures, upstream 400/500 details. |
info |
Startup status, preflight success, token lifecycle, local HTTP status summaries. |
debug |
Model routing, upstream timings, full request payload diagnostics. |
Invalid values such as warn, trace, or silent fail startup.
grep -n "Startup preflight failed" ~/.copilot-relay/logs/copilot-relay.*.log
grep -n "Failed to create" ~/.copilot-relay/logs/copilot-relay.*.log
grep -n "Failed to refresh Copilot token" ~/.copilot-relay/logs/copilot-relay.*.log
grep -n "Model request" ~/.copilot-relay/logs/copilot-relay.*.log
grep -n "Copilot POST" ~/.copilot-relay/logs/copilot-relay.*.logLook for:
Startup preflight failed
Preflight failed
Required Copilot model
Invalid logLevel
Common causes:
- stale
github_token - missing or expired
copilot_token.json - configured
gptModeloropusModelnot present upstream - invalid
logLevel - invalid/rejected
thinkEffort
Fix auth:
copilot-relay auth
copilot-relay startAt info, you see a short summary:
info POST /v1/messages -> 400 123ms error="Invalid request"
The matching error line includes full context in the same log file:
- upstream route
- model
- request payload
- response status
- response headers
- response body
Search:
grep -n "Failed to create" ~/.copilot-relay/logs/copilot-relay.*.logSet:
logLevel: debugSearch:
grep -n "Model request" ~/.copilot-relay/logs/copilot-relay.*.log
grep -n "effective_think_effort" ~/.copilot-relay/logs/copilot-relay.*.logCheck:
requested_modelupstream_modelrequested_think_efforteffective_think_effort
Compare local request time:
info POST /v1/messages -> 200 8291ms
with upstream time at debug:
debug Copilot POST /chat/completions -> 200 8287ms (attempt 1)
If the numbers are close, the delay is upstream/model latency.
Check:
grep -n "Using cached Copilot token\|Next Copilot token refresh\|Failed to refresh Copilot token" ~/.copilot-relay/logs/copilot-relay.*.logIf refresh repeatedly fails, run:
copilot-relay authDo not share full debug logs publicly without review. Debug logs can contain
prompts and tool payloads.
For bug reports, include:
- exact timestamp
- relevant
inforequest summary - matching
errorblock if present - whether
debugwas enabled - sanitized
~/.copilot-relay/config.yaml