You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
However, if forwardErrorsToLogs is omitted from the initial configuration, this does not happen, despite the fact that forwardErrorsToLogs defaults to true.
Datadog should behave the same when forwardErrorsToLogs: true and when forwardErrorsToLogs is omitted.
The text was updated successfully, but these errors were encountered:
On a related note, I find it strange that you can't opt out from console.error collection when forwardErrorsToLogs is specified, even when specifying forwardConsoleLogs: [].
(When specifying forwardErrorsToLogs: true, forwardConsoleLogs: [], Datadog will resolve the configuration as forwardConsoleLogs: ['error'].)
Ooh thank you for pointing that out, we'll fix this.
On a related note, I find it strange that you can't opt out from console.error collection when forwardErrorsToLogs is specified, even when specifying forwardConsoleLogs: [].
I agree that it can be a bit confusing. To understand why it works like this: at first we had forwardErrorsToLogs but not forwardConsoleLogs. At this time, when setting forwardErrorsToLogs: true, we considered console.error to be errors, and forwarded it as such. When we introduced forwardConsoleLogs, we didn't want to change the forwardErrorsToLogs behavior, this is why we enforce forwarding error logs in this case. I hope it makes sense.
Thank you for the feedback, we might consider clarifying things in a future major version.
It seems to be a breaking change: users using the default configuration would start collecting console.error without opting in. I added this to the list to do for our next major.
When
forwardErrorsToLogs
is explicitly enabled, Datadog addserror
toforwardConsoleLogs
:browser-sdk/packages/logs/src/domain/configuration.ts
Lines 85 to 87 in 8df6ac0
However, if
forwardErrorsToLogs
is omitted from the initial configuration, this does not happen, despite the fact thatforwardErrorsToLogs
defaults to true.Datadog should behave the same when
forwardErrorsToLogs: true
and whenforwardErrorsToLogs
is omitted.The text was updated successfully, but these errors were encountered: