---
title: "CaptureConsole"
description: "Captures all Console API calls via `captureException` or `captureMessage`."
url: https://docs.sentry.io/platforms/javascript/guides/connect/configuration/integrations/captureconsole/
---

# CaptureConsole | Sentry for Connect

*Import name: `Sentry.captureConsoleIntegration`*

This integration captures all Console API calls and redirects them to Sentry using the SDK's captureMessage or captureException call, depending on the log level. It then re-triggers to preserve default native behavior:

```javascript
import * as Sentry from "@sentry/node";

Sentry.init({
  dsn: "___PUBLIC_DSN___",
  integrations: [Sentry.captureConsoleIntegration()],
});
```

## [Options](https://docs.sentry.io/platforms/javascript/guides/connect/configuration/integrations/captureconsole.md#options)

### [`levels`](https://docs.sentry.io/platforms/javascript/guides/connect/configuration/integrations/captureconsole.md#levels)

*Type: `string[]`*

Array of methods that should be captured. Defaults to `['log', 'info', 'warn', 'error', 'debug', 'assert']`
