-
Notifications
You must be signed in to change notification settings - Fork 41.2k
Provide an optional endpoint for logging Javascript errors #3976
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
Comments
This would definitely be helpful for us. We have a large suite of Selenium tests. We've not found a happy and stable way to fail the tests when a javascript error occurs. |
👍 this would be hugely helpful. As @jchesterpivotal said, we also have selenium tests, and we also have no great way other than to try and replicate locally. |
Please find in this gist a sample client side implementation. I do not expect we reuse it exactly as it is, but it is IMO a nice starting point for experimenting and discussing. Any thoughts? |
@sdeleuze I think we should look at this for 1.4 as we're close to feature freeze on 1.3. It's a really nice idea but I think we're just going to run out of time for 1.3.x :( |
Someone could take Sebastien's code and publish it as a jar that anyone can consume in 1.3 (like I did with Jersey in 1.1). Then we can get people using it and build the features up for 1.4. |
👍 |
I totally agree, any javascript code provided with Spring Boot will require a lot of testing with many browsers, so targeting 1.4 will allow us to get feedbacks, improve this draft implementation, etc. |
Given all the testing that will be required I think it's best if we push this back to 2.0 where we can get it into an early milestone. |
We have also experimented with client to server logging on our projects. A few things that you might want to consider:
I might be able to contribute to this PR. Although our implementation is fairly specific to a given environment (TypeScript), it should not be a huge effort to convert parts of it to native Javascript. |
Hey @szmeti, I would be very interested to see your TypeScript version if possible. |
Hi @sdeleuze, I only found some time today to respond to this. I have created a gist with the code: https://gist.github.com/szmeti/5eefe2719eb54ea0276eb64c7c4c2097 I added some comments to the code and you will need to get familiar with the loglevel library (https://github.com/pimterry/loglevel), because we used that as the underlying logging framework. Otherwise, the code is pretty straightforward I think. |
Hi, One year ago, i made some experiments to "unminify" the sources on the server side. The client sends the stackstrace to the server but if the source is minified, the logs are not "ready to debug"; you need to use the source maps to read them. Here is a POC (all comments are welcome :-) : Reagrds |
In hindsight this is likely to add complexity to the code base that we don't really want. |
When you are building a Java + Javascript based application with a significant complexity on client side (Angular, Ember or React application), a big issue is that you have no idea of the errors that occur on client side.
A good solution I have already experimented on big projects is composed of 2 parts:
console.log()
to send an HTTP request/websocket message to the server with the errorIt should be possible to change the client log level you send to the server dynamically.
This is a little bit more a client/server integration thing than usual, but on the projects I tested that it was just hugely useful some I think we should provide this in Boot. I will be happy to contribute a PR if you think this is something interesting.
The text was updated successfully, but these errors were encountered: