Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions includes/logs/javascript-console-logging-integration.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,18 @@ Sentry.init({
```

The `consoleLoggingIntegration` accepts a `levels` option, which is an array of console method names to log. By default the integration will log calls from `console.debug`, `console.info`, `console.warn`, `console.error`, `console.log`, `console.assert`, and `console.trace`.

If you provide multiple arguments to your `console` object calls the integration will parse them as different attributes, which can be searched and filtered for in the Sentry UI. This requires SDK version [`10.13.0`](https://github.com/getsentry/sentry-javascript/releases/tag/10.13.0) or higher.

```js
// This will be logged as:
// {
// "message": "Executed Action for User: 123 true",
// "attributes": {
// "message.template": "Executed Action for User: {} {}",
// "message.parameter.0": 123,
// "message.parameter.1": true
// }
// }
console.log("Executed Action for User:", 123, true);
```
Loading