If you would like to get the event logs in real-time, we recommend you should use Web socket method rather than usage of 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 of the time between them.
Therefore, you need get the real-time logs via Web socket.
Below is an example to get the event logs via Web socket. Follow the instructions below.
- Set BioStar to use HTTPS.
- Copy & paste the attached file named “ws_biostar2.html” to below path.
- C:\Program Files\BioStar 2(x64)\nginx\html
- C:\Program Files\BioStar 2(x64)\nginx\html
- Set IP address of the host where BioStar 2 Server runs. In the other words, change IP address of IP address of the host marked as RED box.
- Access to https://[your host server’s IP & port number]/ws_biostar2.html through Chrome browser. For instance, in case of 3), you should enter https://192.168.0.20:443/ws_biostar2.html to the address window.
- Then, you can see below screen.
- In the Chrome browser, press the keyboard “F12” to open debugging mode.
- After enter ID and Password in order to access to BioStar 2 Server, click Login button.
- 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 mouse-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.