the If you would like to get the event logs in real-time, we recommend using the WebSocket method rather than BioStar 2 API. This is because, once an event log is generated, it will be displayed in the monitoring section of BioStar 2 first and then it will be saved in BioStar 2 DB after a few seconds(approximately 3~10 seconds). There is a little gap in between, which means you won't be getting 'real-time' results via API since API receives data from the database.
Below is an example of how to get the event logs via WebSocket. Follow the instructions below.
1.Set BioStar to use HTTPS.
2.Copy & paste the attached file named “ws_biostar2.html” to the below path.
- C:\Program Files\BioStar 2(x64)\nginx\html\modules\
3. Open and edit ws_biostar2.html file.
In the part marked in the red box below, change the IP address to your BioStar 2 server IP address.
4. Access to https://[BioStar server IP]/modules/ws_biostar2.html through Chrome browser.
Then, you'll see a screen like below.
5. In the Chrome browser, press “F12” to open debugging mode.
6. Enter login ID and Password in order to access the BioStar 2 Server, then click the Login button.
7. Then, check the real-time logs in the MessageEvent. If you see the detailed MessageEvent, you can check the information on event_type_id such as code, name and descriptions.
(If you hover over the event log, you can confirm the detailed information about the event log.)
By parsing this MessageEvent, you can get the real-time event logs.
Please note that you should handle the socket connection by yourself.