Skip to content

💥 [RUM-8693] Decouple forwardErrorsToLogs from console.error log capture#4356

Merged
bdibon merged 2 commits intov7from
boris.dibon/fix-forwardErrorsToLogs-forwardConsoleLogs-behavior
Mar 18, 2026
Merged

💥 [RUM-8693] Decouple forwardErrorsToLogs from console.error log capture#4356
bdibon merged 2 commits intov7from
boris.dibon/fix-forwardErrorsToLogs-forwardConsoleLogs-behavior

Conversation

@bdibon
Copy link
Contributor

@bdibon bdibon commented Mar 18, 2026

Motivation

Two related issues were raised (see #3356):

  1. Inconsistent behavior: when forwardErrorsToLogs is explicitly set to true, console.error calls are forwarded to intake (as if forwardConsoleLogs: ['error'] was configured) — but when forwardErrorsToLogs is omitted and relies on its true default, this doesn't happen.
  2. No opt-out: users could not stop console.error from being forwarded by setting forwardConsoleLogs: [], because forwardErrorsToLogs: true would silently re-add 'error' to the list.

Changes

Break the link between forwardErrorsToLogs and console.error log capture: console.error is now only forwarded when forwardConsoleLogs explicitly includes 'error'.

Test instructions

  1. yarn test:unit --spec packages/logs/src/domain/configuration.spec.ts
  2. yarn test:unit --spec packages/logs/src/domain/console/consoleCollection.spec.ts
  3. yarn test:e2e -g "logs"

Checklist

  • Tested locally
  • Tested on staging
  • Added unit tests for this change.
  • Added e2e/integration tests for this change.
  • Updated documentation and/or relevant AGENTS.md file

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@cit-pr-commenter-54b7da
Copy link

cit-pr-commenter-54b7da bot commented Mar 18, 2026

Bundles Sizes Evolution

📦 Bundle Name Base Size Local Size 𝚫 𝚫% Status
Rum N/A 171.17 KiB N/A N/A N/A
Rum Profiler N/A 6.18 KiB N/A N/A N/A
Rum Recorder N/A 27.48 KiB N/A N/A N/A
Logs N/A 56.55 KiB N/A N/A N/A
Rum Slim N/A 128.39 KiB N/A N/A N/A
Worker N/A 23.63 KiB N/A N/A N/A
🚀 CPU Performance
Action Name Base CPU Time (ms) Local CPU Time (ms) 𝚫%
addglobalcontext N/A 0.0042 N/A
addaction N/A 0.0133 N/A
adderror N/A 0.0137 N/A
addtiming N/A 0.0028 N/A
startview N/A 0.0141 N/A
startstopsessionreplayrecording N/A 0.0011 N/A
logmessage N/A 0.0204 N/A
🧠 Memory Performance
Action Name Base Memory Consumption Local Memory Consumption 𝚫
addglobalcontext N/A 34.01 KiB N/A
addaction N/A 58.51 KiB N/A
addtiming N/A 34.39 KiB N/A
adderror N/A 62.65 KiB N/A
startstopsessionreplayrecording N/A 33.80 KiB N/A
startview N/A 468.04 KiB N/A
logmessage N/A 48.91 KiB N/A

🔗 RealWorld

@bdibon bdibon changed the title 💥 Decouple forwardErrorsToLogs from console.error log capture 💥 [RUM-8693] Decouple forwardErrorsToLogs from console.error log capture Mar 18, 2026
@datadog-prod-us1-4
Copy link

datadog-prod-us1-4 bot commented Mar 18, 2026

✅ Tests

🎉 All green!

❄️ No new flaky tests detected
🧪 All tests passed

🎯 Code Coverage (details)
Patch Coverage: 100.00%
Overall Coverage: 77.21%

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: 77688fc | Docs | Datadog PR Page | Was this helpful? React with 👍/👎 or give us feedback!

@bdibon bdibon marked this pull request as ready for review March 18, 2026 10:08
@bdibon bdibon requested a review from a team as a code owner March 18, 2026 10:08
@bdibon bdibon merged commit f6b95d6 into v7 Mar 18, 2026
19 checks passed
@bdibon bdibon deleted the boris.dibon/fix-forwardErrorsToLogs-forwardConsoleLogs-behavior branch March 18, 2026 15:47
@github-actions github-actions bot locked and limited conversation to collaborators Mar 18, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants