Skip to content

Commit eb3c127

Browse files
Copilotlpcox
andcommitted
Update AGENTS.md with per-serverID logging documentation
Added documentation for: - Per-serverID log files in the log directory structure - LogInfoWithServer/LogWarnWithServer/LogErrorWithServer/LogDebugWithServer functions - Benefits of per-serverID logging for troubleshooting Co-authored-by: lpcox <15877973+lpcox@users.noreply.github.com>
1 parent 0303b75 commit eb3c127

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

AGENTS.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -366,11 +366,23 @@ DEBUG_COLORS=0 DEBUG=* ./awmg --config config.toml
366366
- `MCP_GATEWAY_PAYLOAD_DIR` - Large payload storage directory (sets default for `--payload-dir` flag, default: `/tmp/jq-payloads`)
367367

368368
**File Logging:**
369-
- Operational logs are always written to `mcp-gateway.log` in the configured log directory
369+
- Operational logs are always written to log files in the configured log directory
370370
- Default log directory: `/tmp/gh-aw/mcp-logs` (configurable via `--log-dir` flag or `MCP_GATEWAY_LOG_DIR` env var)
371371
- Falls back to stdout if log directory cannot be created
372+
- **Log Files Created:**
373+
- `mcp-gateway.log` - Unified log with all messages
374+
- `{serverID}.log` - Per-server logs (e.g., `github.log`, `slack.log`) for easier troubleshooting
375+
- `gateway.md` - Markdown-formatted logs for GitHub workflow previews
376+
- `rpc-messages.jsonl` - Machine-readable JSONL format for RPC message analysis
372377
- Logs include: startup, client interactions, backend operations, auth events, errors
373378

379+
**Per-ServerID Logging:**
380+
- Each backend MCP server gets its own log file for easier troubleshooting
381+
- Use `LogInfoWithServer`, `LogWarnWithServer`, `LogErrorWithServer`, `LogDebugWithServer` functions
382+
- Example: `logger.LogInfoWithServer("github", "backend", "Server started successfully")`
383+
- Logs are written to both the server-specific file and the unified `mcp-gateway.log`
384+
- Thread-safe concurrent logging with automatic fallback
385+
374386
**Large Payload Handling:**
375387
- Large tool response payloads are stored in the configured payload directory
376388
- Default payload directory: `/tmp/jq-payloads` (configurable via `--payload-dir` flag, `MCP_GATEWAY_PAYLOAD_DIR` env var, or `payload_dir` in config)

0 commit comments

Comments
 (0)