-
Notifications
You must be signed in to change notification settings - Fork 42
Logging feature #81
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
Logging feature #81
Conversation
added Logging route
added logging to react router
…ow", set timeout to retry connection if it fails
… SSE logging message
set INFO level on custom logger (level in client) removed unused log handler Formatter fixed bug: some log records do not have '.asctime'
hi, some questions:
var socket = io.connect('http://' + document.domain + ':' + location.port+'/test');// + namespace);
socket.emit('my event', {data: 'I\'m connected!'});
socket.on('test', function(msg) {
console.log(msg)
}
Is it ok if we postpone the acceptance of this PR until we discuss it on Friday? |
You're right we should use websockets only as we decided that, so I am going to update the PR with websocket instead of SSE. I agree on the need for an external server to store log and to display log info (my favourite is Sentry) but the deadline on this issue #14 is January so I wanted to provide a solution for the time being. We can postpone it until Friday, no problem. |
tried to get webpack-dev-server *proxy* configuration right for websockets, in fact the feature is not 100% ready yet, and it is also unclear what to do with flask-socketio in this respect
…uce static files to be hosted by MXCuBE 3 server
Finally I managed to make it working with socket.io ! Yeepee. In fact, it was almost ok since the beginning, but I could not see it working in my environment. Why? Read below if you are interested: I have the following setup:
It turns out webpack-dev-server proxy doesn't handle websockets properly at the moment (see webpack/webpack-dev-server#283 - it's a long story). In our particular case, with flask-socketio on the server side, even the previous bug fix (webpack/webpack-dev-server#302) is not enough at least I could not do anything to make it work. It is quite annoying, but I am going to follow what happens and maybe a solution will come in the next weeks ; I really like the possibility to have mxcube3 server running on a beamline computer while I am working on the web application on my debian 7 computer. As it is now, I won't be able to see logging messages via a websocket, it will go through xhr polling at best (gracefully degraded by socketio). Could we merge this PR now ? Thanks a lot ! PS: I took the opportunity to fix dependencies in package.json to the right versions and I updated the webpack production config. |
(sorry for PR #80, I made a mistake with git in my own repo and it was closed automatically)
I implemented a basic logging feature for MXCuBE 3 ; it should close #14 I guess.
What has been done:
Any comments/feedback would be highly appreciated.
PS: I hate the fact that react-router unmounts / remount components when changing from one page to another but I could not find any workaround, except moving 'System log' out of react-router control. Well, it works so it's ok but in fact this is why I had to make the global event listener it's not very clean IMO
PPS: this PR also deletes a file we don't need anymore (test samples list)