Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No Console Logs Recorded in the Session Replay #12244

Closed
3 tasks done
Kobby-Bawuah opened this issue May 27, 2024 · 7 comments
Closed
3 tasks done

No Console Logs Recorded in the Session Replay #12244

Kobby-Bawuah opened this issue May 27, 2024 · 7 comments
Labels
Package: browser Issues related to the Sentry Browser SDK Package: replay Issues related to the Sentry Replay SDK Type: Bug

Comments

@Kobby-Bawuah
Copy link

Is there an existing issue for this?

How do you use Sentry?

Sentry Saas (sentry.io)

Which SDK are you using?

@sentry/browser

SDK Version

8.4.0

Framework Version

No response

Link to Sentry event

No response

SDK Setup

init

Steps to Reproduce

  • Implement Sentry as described in the attached screenshots.
  • Trigger console.log() statements in the client.
  • Check the session replay for recorded console logs.

Expected Result

console.log() statements should be visible in the session replay.

Actual Result

No console.log() statements are visible, although errors are correctly reported.

my_console

@getsantry getsantry bot moved this to Waiting for: Product Owner in GitHub Issues with 👀 3 May 27, 2024
@github-actions github-actions bot added the Package: browser Issues related to the Sentry Browser SDK label May 27, 2024
@AbhiPrasad AbhiPrasad added the Package: replay Issues related to the Sentry Replay SDK label May 27, 2024
@mydea
Copy link
Member

mydea commented May 28, 2024

Hey,

we have tests specifically ensuring that this works 🤔 do you have a link to a replay where this happens? Could you try with debug: true enabled, would be interesting to see where the logs go in terms of timeline.

@billyvg
Copy link
Member

billyvg commented May 28, 2024

@mydea do we have any size limits on console logs? The log message seems to be quite big.

For the error, it looks like it's an uncaught rejection which is capture as an exception to Sentry. We do not display these in the Console tab of Replay unless it was explicitly called with console.error().

@Hugo-Dz
Copy link

Hugo-Dz commented May 28, 2024

@mydea do we have any size limits on console logs? The log message seems to be quite big.

For the error, it looks like it's an uncaught rejection which is capture as an exception to Sentry. We do not display these in the Console tab of Replay unless it was explicitly called with console.error().

Do you mean it doesn't record console.log() but only console.error()?

@mydea
Copy link
Member

mydea commented May 29, 2024

@mydea do we have any size limits on console logs? The log message seems to be quite big.

We truncate logs when we add them as breadcrumbs to replay - we have specifically a test for this 😅 https://github.com/getsentry/sentry-javascript/blob/develop/dev-packages/browser-integration-tests/suites/replay/captureConsoleLog/test.ts#L59

mydea added a commit that referenced this issue May 29, 2024
Noticed this while looking into
#12244, console
should be instrumented just fine in the CDN bundle.
@billyvg
Copy link
Member

billyvg commented May 30, 2024

@Hugo-Dz no, we capture both, I was more remarking that the Error message you see in the console is not called with console.error and so it's expected that you won't see it in the Replay's Console tab (this is because it's captured as an exception and displayed in Breadcrumbs).

Can you give us a repro for this? Or a publicly accessible URL where we can debug?

@Hugo-Dz
Copy link

Hugo-Dz commented May 30, 2024

@billyvg For some reasons, logs now shows up in my Replays, not sure why it was not the case before 🤔

You can close this :)

@getsantry getsantry bot moved this to Waiting for: Product Owner in GitHub Issues with 👀 3 May 30, 2024
@mydea
Copy link
Member

mydea commented May 31, 2024

If somebody encounters this again, please re-open the issue!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Package: browser Issues related to the Sentry Browser SDK Package: replay Issues related to the Sentry Replay SDK Type: Bug
Projects
Archived in project
Development

No branches or pull requests

5 participants