Skip to main content

CLI Commands

logs

The logs command displays logs from running MCP server instances.

Usage

cogni logs [OPTIONS] [SERVER_ID]

Description

The logs command allows you to view real-time logs from an MCP server instance that is currently running. This is useful for debugging, monitoring server activity, and tracking errors. By default, it shows logs from all running servers, but you can specify a particular server ID to focus on just that instance.

Options

OptionDescription
--follow, -fFollow log output in real-time (like tail -f)
--tail INTEGERNumber of recent log lines to show (default: 100)
--since TEXTShow logs since timestamp (e.g., “10m” for 10 minutes ago)
--until TEXTShow logs until timestamp
--timestamps, -tShow timestamps with log entries
--debug, -dInclude debug-level logs in the output
--helpShow help message for the logs command

Arguments

ArgumentDescription
SERVER_ID(Optional) The ID or name of the server to show logs for

Examples

# Show recent logs for all servers
cogni logs

# Show logs for a specific server
cogni logs my-gpt4-server

# Follow logs in real-time for a specific server
cogni logs --follow my-gpt4-server

# Show only the most recent 50 lines of logs
cogni logs --tail 50 my-gpt4-server

# Show logs from the last 30 minutes
cogni logs --since 30m my-gpt4-server

# Show logs with timestamps
cogni logs --timestamps my-gpt4-server

Output

The command outputs log entries in chronological order:
[2023-10-15 14:23:45] Server starting...
[2023-10-15 14:23:46] Loading model weights...
[2023-10-15 14:23:50] Model loaded successfully
[2023-10-15 14:23:50] Server listening on port 8080
[2023-10-15 14:24:02] Received request: /v1/completions
[2023-10-15 14:24:03] Request processed successfully
With --follow, new log entries appear in real-time as they are generated.

Tips

  • Use --follow to watch logs in real-time during development or debugging
  • Combine --since with --follow to see recent history plus new logs
  • For issues with server startup, check logs without specifying a SERVER_ID
  • Use --timestamps to correlate log events with other system activities