Agent Debug Log Collector
Automatically collects VS Code Copilot agent debug logs and posts them to your custom API endpoint for centralized team monitoring.
Features
- Automatic collection — Watches Copilot agent debug log files for new entries in real-time
- Cross-platform — Works on macOS, Windows, and Linux
- Batched sending — Queues entries and sends them in configurable batches
- Retry with backoff — Failed requests are retried with exponential backoff
- Persistent queue — Unsent entries survive VS Code restarts
- Privacy-first — Disabled by default, requires explicit opt-in
- Status bar — Visual indicator showing collection status
Setup
- Install the extension from the VS Code Marketplace
- Run command: Agent Log Collector: Enable
- Enter your API endpoint URL when prompted
- (Optional) Set an API key in settings for authentication
Configuration
| Setting |
Default |
Description |
agentLogCollector.enabled |
false |
Enable/disable log collection |
agentLogCollector.apiEndpoint |
"" |
Your API endpoint URL for POSTing logs |
agentLogCollector.apiKey |
"" |
Bearer token for API authentication |
agentLogCollector.userName |
OS username |
Display name in the dashboard |
agentLogCollector.batchSize |
50 |
Max entries per API request |
agentLogCollector.flushIntervalSeconds |
30 |
Flush interval in seconds |
agentLogCollector.retryAttempts |
3 |
Retry count for failed requests |
Commands
| Command |
Description |
| Agent Log Collector: Enable |
Enable collection and configure endpoint |
| Agent Log Collector: Disable |
Stop collecting logs |
| Agent Log Collector: Sync Now |
Manually flush all pending entries |
| Agent Log Collector: Show Status |
Display collection stats |
| Agent Log Collector: Clear Pending Queue |
Discard all queued entries |
| Agent Log Collector: Show Output Log |
Open the extension's output channel |
The extension sends a POST request to your endpoint with this JSON body:
{
"userId": "anonymous-machine-id",
"userName": "john.doe",
"sentAt": "2024-01-15T10:30:00.000Z",
"entries": [
{
"sessionId": "abc123-def456",
"timestamp": "2024-01-15T10:29:55.000Z",
"type": "llm_request",
"model": "gpt-4",
"durationMs": 1250,
"inputTokens": 1200,
"outputTokens": 340,
"cachedTokens": 40
}
]
}
| Header |
Value |
Content-Type |
application/json |
Authorization |
Bearer <your-api-key> (if configured) |
X-Client |
vscode-agent-log-collector |
Building Your API
Your API endpoint needs to accept POST requests with the payload above. A minimal example:
app.post('/api/logs', (req, res) => {
const { userId, userName, entries } = req.body;
// Store entries in your database
console.log(`Received ${entries.length} entries from ${userName}`);
res.status(200).json({ status: 'ok' });
});
The extension considers any 2xx response as successful. On 4xx errors (except 429), it won't retry. On 5xx or network errors, it retries with exponential backoff.
Privacy & Security
- Opt-in only — Collection is disabled by default
- Anonymous ID — Uses VS Code's
machineId (a hashed hardware identifier, not personally identifiable)
- No telemetry — The extension does not phone home to any service other than your configured endpoint
- Transparent — All collected data is visible in the Output panel ("Agent Log Collector")
Note: Debug logs may contain file paths, code snippets, and conversation context. Ensure your API endpoint uses HTTPS and access is restricted to authorized team members.
Requirements
- VS Code 1.85 or later
- GitHub Copilot Chat extension (generates the debug logs)
License
MIT