Problem with javascript API logging
AnsweredSummary
Web / Javascript API debug message didn't appear.
Server version: 5.0.0.35270
Description
I made web charts and UI to integrate NX Witness better with my own server.
https://github.com/networkoptix/nx_open_integrations/tree/master/js_api_example
Followed the js_api_example, tried to make some debug messages show up,
with the original settings of "window.vms.log.info", "window.vms.log.error" inside the sample code.
but I cannot find them anywhere when they should show up.
Neither "Event Log" inside NX Witness, nor the log file inside "server/log" folder.
Questions:
1. Where can I see the logs?
2. What is the best practice to debug web in built-in browser, since it's lack of development console?
-
Hello,
there are several options.
1. Instead of window.vms.log, use the vms.log object. For example,
vms.log.error(“some sort of error message”)
logs message with ERROR log level to the Nx Wintess log file.
See https://meta.nxvms.com/docs/developers/knowledgebase/328-in-client-javascript-api for detail on JS API.
See https://support.networkoptix.com/hc/en-us/articles/8503187042455-How-to-Change-Software-Logging-Level-and-Get-Logs- for details on log files and levels.
2. Use developer console for logging.
You could define the QTWEBENGINE_REMOTE_DEBUGGING environment variable in the session where the NX Witness runs. For example,QTWEBENGINE_REMOTE_DEBUGGING=1111
Start the Nx Witness application.
Open your web page in Nx Witness.
Open your browser and connect to 127.0.0.1:1111 to access the developer console.
0 -
Hello
I tried your given option but not working on my side
0 -
Hi,
On Windows
1. In the "Advanced system settings" set the environment variable.
QTWEBENGINE_REMOTE_DEBUGGING=1111
2. Relogin to your user session.
3. Start the Nx Witness application.
4. Open a web page in the Nx Witness application.
5. Open a Chrome browser and connect to localhost:1111
On Linux
1. in terminal launch this command
echo "export QTWEBENGINE_REMOTE_DEBUGGING=1111" >> ~/.profile
Repeat steps 2 - 5
0
Please sign in to leave a comment.
Comments
3 comments