Easier access to logs at startup

Updated documentation
This commit is contained in:
Fahad
2025-06-15 07:09:44 +04:00
parent 99fab3e83d
commit 318b5c7ae7
4 changed files with 65 additions and 9 deletions

View File

@@ -1,14 +1,30 @@
# Logging
## Quick Start - Follow Logs
The easiest way to monitor logs is to use the `-f` flag when starting the server:
```bash
# Start server and automatically follow MCP logs
./run-server.sh -f
```
This will start the server and immediately begin tailing the MCP server logs.
## Viewing Logs in Docker
To monitor MCP server activity in real-time:
```bash
# View all container logs
docker-compose logs -f
# Follow MCP server logs (recommended)
docker exec zen-mcp-server tail -f -n 500 /tmp/mcp_server.log
# Or use the -f flag when starting the server
./run-server.sh -f
```
**Note**: Due to MCP protocol limitations, container logs don't show tool execution details. Always use the commands above for debugging.
## Log Files
Logs are stored in the container's `/tmp/` directory and rotate daily at midnight, keeping 7 days of history:

View File

@@ -8,6 +8,7 @@ This project includes comprehensive test coverage through unit tests and integra
- Python virtual environment activated: `source venv/bin/activate`
- All dependencies installed: `pip install -r requirements.txt`
- Docker containers running (for simulator tests): `./run-server.sh`
- Use `./run-server.sh -f` to automatically follow logs after starting
### Unit Tests
@@ -37,7 +38,10 @@ Simulator tests replicate real-world Claude CLI interactions with the MCP server
To monitor logs during test execution:
```bash
# Monitor main server logs (includes all tool execution details)
# Start server and automatically follow logs
./run-server.sh -f
# Or manually monitor main server logs (includes all tool execution details)
docker exec zen-mcp-server tail -f -n 500 /tmp/mcp_server.log
# Monitor MCP activity logs (tool calls and completions)

View File

@@ -43,7 +43,11 @@ cat .env
If you need to update your API keys, edit the `.env` file and then run:
```bash
# Restart services
./run-server.sh
# Or restart and follow logs for troubleshooting
./run-server.sh -f
```
This will validate your configuration and restart the services.
@@ -56,13 +60,15 @@ View the container logs for detailed error information:
# Check if containers are running
docker-compose ps
# View all logs
docker-compose logs -f
# View MCP server logs (recommended - shows actual tool execution)
docker exec zen-mcp-server tail -f -n 500 /tmp/mcp_server.log
# View specific service logs
docker-compose logs -f zen-mcp
# Or use the -f flag when starting to automatically follow logs
./run-server.sh -f
```
**Note**: Due to MCP protocol limitations, `docker-compose logs` only shows startup logs, not tool execution logs. Always use the docker exec command above or the `-f` flag for debugging.
See [Logging Documentation](logging.md) for more details on accessing logs.
### 5. Common Issues