Accessing the Event Log

Posted on
Fri Feb 02, 2018 2:43 pm
vtmikel offline
Posts: 628
Joined: Aug 31, 2012
Location: Boston, MA

Accessing the Event Log

Who knows where the right place to post this question is...

Has anyone wanted to get access to the full Event Log message stream on the local network? I'm considering a dedicated dashboard, combining some of the stuff that I've done in Grafana (https://www.dropbox.com/s/9nho6p1ijqv1hww/Dashboard%20Picture.png?dl=0), with a Control Page (floor plan view), and the Event Log. Might use a Raspberry Pi for the dashboard, so using the Indigo client wouldn't be an option.

I realized as I was thinking about this that I don't think there is a easy way to get the event log from the existing Indigo extension mechanisms. Perhaps a Indigo Web plugin? How hard would that be? Otherwise perhaps I'll make the event log txt file available on a separate web server.

Mike

Posted on
Fri Feb 02, 2018 4:53 pm
jay (support) offline
Site Admin
User avatar
Posts: 18200
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Accessing the Event Log

Use the following command in your plugin:

Code: Select all
indigo.server.subscribeToLogBroadcasts()


After which the server will start calling this method for every line that goes into the Event Log (just implement it in your plugin):

Code: Select all
   ########################################
   def eventLogLineReceived(self, entry):
      ts = entry["TimeStamp"]      # datetime
      typeval = entry["TypeVal"]   # integer
      typestr = entry["TypeStr"]   # string
      message = entry["Message"]   # string
      iserror = (typeval == 1)   # bool


I can't tell you exactly what entry["TypeVal"] means off the top of my head, but entry["TypeStr"] is the first thing you see in the event log window, and entry["Message"] is the thing that follows that (after the tab). the other things are self-explanatory. Once I figure it out I'll add the details to the Server Commands section of the developer docs.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 15 guests