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

How do we log contents of JSON responses? #468

Open
tansongyang opened this issue Jun 1, 2022 · 2 comments
Open

How do we log contents of JSON responses? #468

tansongyang opened this issue Jun 1, 2022 · 2 comments

Comments

@tansongyang
Copy link

I tried turning on logContentsOfXhrCalls in our application. Request bodies get sent just fine, but response bodies are not.

The problem appears to be here. This guard checks if the responseType is empty string or 'text'. If so, the response text is included. Otherwise, we get the default text 'N/A for non text responses', which is what I'm seeing. And it's because I'm dealing with responseType === 'blob', specifically a JSON blob.

What is the guidance here?

@Widdershin
Copy link
Contributor

Hi @tansongyang,

Thanks for reporting this issue. We have some updates planned to this library, so I'll investigate expanding the supported response types for logContentsOfXhrCalls as part of this work.

As it stands I don't think logging blob responses is currently possible with raygun4js. One workaround would be to add another wrapper to XMLHttpRequest to log these response bodies, following the same style as the raygun.network-tracking.js file linked.

@tansongyang
Copy link
Author

@Widdershin Thanks for the quick response! Good to know about the workaround.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants