> ## Documentation Index
> Fetch the complete documentation index at: https://docs.agentcat.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Debug Mode

> Enable debug logging to troubleshoot your AgentCat integration.

AgentCat can write detailed logs to `~/agentcat.log` to help you troubleshoot integration issues. Debug mode is off by default and needs to be enabled in your tracking configuration.

The log file includes information about event batching, session management, telemetry delivery, and any errors the SDK encounters.

## Enabling Debug Mode

Pass the debug option when calling `agentcat.track()`:

<CodeGroup>
  ```typescript TypeScript theme={null}
  import * as agentcat from "agentcat"

  agentcat.track(mcpServer, "proj_abc123xyz", {
    debug: true
  })

  ```

  ```python Python theme={null}
  import agentcat

  agentcat.track(server, "proj_abc123xyz",
               agentcat.AgentCatOptions(debug_mode=True))
  ```

  ```go Go theme={null}
  import mcpcat "github.com/mcpcat/mcpcat-go-sdk/officialsdk"
  // For mark3labs/mcp-go: import mcpcat "github.com/mcpcat/mcpcat-go-sdk/mcpgo"

  mcpcat.Track(s, "proj_abc123xyz", &mcpcat.Options{
      Debug: true,
  })
  ```
</CodeGroup>

### Environment Variable

You can also enable debug mode with an environment variable instead of changing your code:

```bash theme={null}
AGENTCAT_DEBUG_MODE=true
```

This accepts `true`, `1`, `yes`, or `on` (case-insensitive).

## Reading the Log File

Logs are written to `~/agentcat.log`. You can tail the file while your server is running to see output in real time:

```bash theme={null}
tail -f ~/agentcat.log
```

## When to Use Debug Mode

Debug mode is useful when:

* Events aren't showing up in the AgentCat dashboard
* You want to verify that tracking is set up correctly
* You need to confirm that user identification is working
* You're troubleshooting exporter or telemetry delivery issues

<Note>
  Debug mode is meant for development and troubleshooting. In production, leave it off to avoid unnecessary disk writes.
</Note>
