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.

  1. Set BioStar to use HTTPS.
  2. Copy & paste the attached file named “ws_biostar2.html” to below path.
    • C:\Program Files\BioStar 2(x64)\nginx\html

  3. 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.
  4. 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 to the address window.
  5. Then, you can see below screen.

  6. In the Chrome browser, press the keyboard “F12” to open debugging mode.

  7. After enter ID and Password in order to access to BioStar 2 Server, click Login button.
  8. 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.)
  9. By parsing this MessageEvent, you can get the real-time event logs.

Please note that you should handle the socket connection by yourself.