Add real-time logging and debugging

You can use notifications to do real-time logging inside your video application.

The notification system allows you to gather logging and debugging information for diagnostics and validation without overly stressing the system.

The logging back end is not part of a production setup and is not expected to handle high-load traffic. So, if your implementation does not need to be absolutely complete, take efficiency of data transmission into consideration so that you do not overload your system.

  1. Create a timer-based execution thread for your video application that periodically queries the data gathered by the PSDK’s notification system.

    This is how the PMPDemoApp implements logging.

    The logging back end is not part of a production setup and is not expected to handle high-load traffic. So, if your implementation does not need to be absolutely complete, you should take efficiency of data transmission into consideration so as not to overload your system.

  2. If the timer's interval is too large and the size of the event list is too small, the notification event list will overflow. To avoid overflowing the notification event list, do either or both of the following:
    • Decrease the time interval that drives the thread that polls for new events.

    • Increase the size of the notification list.

  3. Serialize the new notification event entries in JSON format and send them to a remote server for postprocessing.

    The remote server could then graphically display the provided data in real-time.

  4. To detect the loss of notification events, look for gaps in the sequence of event index values.

    Each notification event has an index value that is automatically incremented by the session.NotificationHistory class.