From 8a8e392047b0b4de59880ce28dd5f3d9a02e1707 Mon Sep 17 00:00:00 2001 From: Abhijeet Prasad Date: Tue, 23 Sep 2025 14:18:04 -0400 Subject: [PATCH] feat: Add docs about console logging integration templating --- .../javascript-console-logging-integration.mdx | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/includes/logs/javascript-console-logging-integration.mdx b/includes/logs/javascript-console-logging-integration.mdx index 4307aea75229a..e6c05346ad615 100644 --- a/includes/logs/javascript-console-logging-integration.mdx +++ b/includes/logs/javascript-console-logging-integration.mdx @@ -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); +```