Skip to main content

playwriter logfile

Print the paths to the relay server log files. Useful for debugging connection issues and inspecting CDP traffic.
playwriter logfile

Returns

Prints two log file paths to stdout:
relay: /Users/you/.playwriter/relay.log
cdp: /Users/you/.playwriter/cdp.jsonl

Log Files

relay.log
file
Main relay server log file containing:
  • Server startup/shutdown events
  • Extension connection status
  • Error messages and warnings
  • Session lifecycle events
cdp.jsonl
file
Chrome DevTools Protocol event log in JSONL format (one JSON object per line):
  • All CDP commands sent between extension, CLI, MCP, and relay
  • CDP events from the browser
  • Request/response pairs
  • Direction indicators (client→server, server→client)

Exit Codes

  • 0 - Always succeeds

Examples

playwriter logfile

CDP Log Format

Each line in cdp.jsonl is a JSON object with this structure:
{
  "timestamp": "2024-03-02T10:30:45.123Z",
  "direction": "client->server",
  "message": {
    "id": 1,
    "method": "Page.navigate",
    "params": {
      "url": "https://example.com"
    }
  }
}
timestamp
string
ISO 8601 timestamp of the event
direction
string
Message flow direction:
  • client->server - Command from MCP/CLI to extension
  • server->client - Response or event from extension
message
object
The CDP message object containing id, method, and params

Common Use Cases

Debug connection issues

# Check if extension is connected
grep "connected" $(playwriter logfile | grep relay | cut -d' ' -f2)

Analyze CDP traffic

# See all CDP methods used
jq -r '.message.method // "response"' ~/.playwriter/cdp.jsonl | sort | uniq

Find failed commands

# Search for errors in CDP responses
jq 'select(.message.error)' ~/.playwriter/cdp.jsonl

Monitor real-time CDP events

# Watch CDP events as they happen
tail -f ~/.playwriter/cdp.jsonl | jq -r '.direction + " " + (.message.method // "response")'

Build docs developers (and LLMs) love