Differences

This shows you the differences between two versions of the page.

Link to this comparison view

plugins:sql_logger [2012/05/17 13:27]
mattb [Example Queries]
plugins:sql_logger [2013/01/10 10:43] (current)
mattb
Line 15: Line 15:
 By default Indigo will create a SQLite database file inside the logs folder: By default Indigo will create a SQLite database file inside the logs folder:
  
-<code>/Library/Application Support/Perceptive Automation/Indigo 5/Logs/indigo_history.sqlite</code>+<code>/Library/Application Support/Perceptive Automation/Indigo 6/Logs/indigo_history.sqlite</code>
  
 ==== Configuring SQL Logger with PostgreSQL ==== ==== Configuring SQL Logger with PostgreSQL ====
Line 107: Line 107:
  
 For SQLite queries, first change to the directory in which the database file resides: For SQLite queries, first change to the directory in which the database file resides:
-<code>cd /Library/Application\ Support/Perceptive\ Automation/Indigo\ 5/</code>+<code>cd /Library/Application\ Support/Perceptive\ Automation/Indigo\ 6/</code>
  
 SQLite query to retrieve all event log history: SQLite query to retrieve all event log history:
Line 118: Line 118:
 Note that when selecting the timestamp from a SQLite table you must use the notation **''datetime(ts,'localtime')''** so that the internally stored GMC time is translated to your local time. Note that when selecting the timestamp from a SQLite table you must use the notation **''datetime(ts,'localtime')''** so that the internally stored GMC time is translated to your local time.
  
 +===== Events =====
 +
 +The SQL Logger provides a useful event (even if it's not logging anything): **''Error in Event Log''**. This event will fire whenever an error (generated by the Indigo Server, by plugins, or both) appears in the event log. You can perform any actions (like sending an email, etc.).
 +
 +**''Internal Errors''** are errors generated by the IndigoServer directly - so errors from INSTEON and X10 devices, errors with the built-in actions/events (sending emails), etc. These do not include errors that plugins generate or errors that are inserted from scripts.
 +
 +To use the **''Specific Type''** event type, you'll need to use the error type that's shown in the event log window. The error type is the beginning part of an event log line. Each event log entry has a beginning part, then a series of spaces, then the message. The beginning part is the event type. Error event types will always end in the word "Error". Here are some examples:
 +
 +<code>
 +Aug 9, 2012 3:38:10 AM
 +  My Type Error                   this is an error from a script
 +  NOAA Weather Plus Error         Error parsing XML from NOAA for device Weather Forecast: not well-formed (invalid token): line 1, column 111
 +</code>
 +
 +In the configuration dialog for **''Error in Event Log''**, when you select **''Specific Type''** from the **''Errors to monitor for:''** popup, a text field with the label **''Event Type''** will show. You'll enter the text shown above - so for instance if you want to monitor for the first error, you'd enter "My Type Error" in the text field (notice no spaces/tabs before or after). Then, every time an error of that type is detected by the SQL Logger plugin, it will fire that trigger.
 +
 +This is primarily useful for plugin errors although if you have scripts that generate errors it could be used for those as well. For plugins (unless the developer decides otherwise), errors will be generated using the plugin's name with " Error" appended.
plugins/sql_logger.1337279225.txt.gz · Last modified: 2012/05/17 13:27 by mattb