More log files for the people!

Hi Guys,

I did a quick look now on a few apps and the longest log file I found was 5h 45 minutes or a couple of hundred lines. I would like to see longer log files in Hubitat, at least 24h. My argument for this is that Hubitat is aimed at a smart home niche for people who perhaps enjoy the technical aspects of smart home development more than others. Having at least 24h of log files for each app would be an encuragement and a recognition to people to develop more apps. That in turn I think would bring the Hubitat user community closer to the Hubitat platform. Or at least create an opportunity to have bigger log files. In addition to that, HD space is not so expensive any more.

Cheers,

It really depends on the app and/or the settings both that it offers and you choose to utilise in terms of the kinds of logs you choose to record and how long the app allows the logs to be recorded for.

You can, in many situations, choose to record quite detailed logs, sometimes over a long period, but continually doing this is not often a necessary or desirable thing, at least IMO.

Others may have different opinions....

3 Likes

If you do want to keep more detailed logs, you may want to consider sending your logs to an external destination and then reducing them periodically on the HE hub.

1 Like

There's another that I am trying to find that allows exporting to a rpi or similar...

1 Like

No, a java (from memory) project that I have tested and commented on....

1 Like

Found it!! Admittedly not much activity recently.... but not the kind of thing that would generate a lot of chatter...

3 Likes

@magnus.s You can use the Syslog driver from @staylorx, it works very well. Exports all logs to any syslog server.,

2 Likes

Thanks for your feedback. This topic has been previously discussed at length. Hubitat doesn't restrict logging based on time, but rather based on size of the files. The active logs can hold up to 1mb, and the past logs have an additional 1mb worth of data. In normal circumstances, one can retain data for an app or device for days, even months, if not much logging is enabled.

1 Like

If you have any use of InfluxDB you can also use my "InfluxDB Hubitat Live Logger" Driver. It is based on @staylorx driver and takes the live logging data and puts it in a InfluxDB db so you can use a dashboard to view the data externally. It works really well.

Driver:
raw.githubusercontent.com/Mavrrick/Hubitat-by-Mavrrick/refs/heads/main/InfluxDB_Logger_V2/InfluxDB_Hubitat_Live_Logger

Dashboard json for import:

{
  "__inputs": [
    {
      "name": "DS_INFLUXDB_HUBITAT2",
      "label": "InfluxDB Hubitat2",
      "description": "",
      "type": "datasource",
      "pluginId": "influxdb",
      "pluginName": "InfluxDB"
    }
  ],
  "__elements": {},
  "__requires": [
    {
      "type": "grafana",
      "id": "grafana",
      "name": "Grafana",
      "version": "10.4.5"
    },
    {
      "type": "datasource",
      "id": "influxdb",
      "name": "InfluxDB",
      "version": "1.0.0"
    },
    {
      "type": "panel",
      "id": "table",
      "name": "Table",
      "version": ""
    },
    {
      "type": "panel",
      "id": "timeseries",
      "name": "Time series",
      "version": ""
    }
  ],
  "annotations": {
    "list": [
      {
        "builtIn": 1,
        "datasource": {
          "type": "datasource",
          "uid": "grafana"
        },
        "enable": true,
        "hide": true,
        "iconColor": "rgba(0, 211, 255, 1)",
        "name": "Annotations & Alerts",
        "target": {
          "limit": 100,
          "matchAny": false,
          "tags": [],
          "type": "dashboard"
        },
        "type": "dashboard"
      }
    ]
  },
  "description": "Telegraf / InfluxDB / Grafana as syslog receiver",
  "editable": true,
  "fiscalYearStartMonth": 0,
  "gnetId": 12433,
  "graphTooltip": 0,
  "id": null,
  "links": [],
  "liveNow": false,
  "panels": [
    {
      "datasource": {
        "type": "influxdb",
        "uid": "${DS_INFLUXDB_HUBITAT2}"
      },
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "palette-classic"
          },
          "custom": {
            "axisBorderShow": false,
            "axisCenteredZero": false,
            "axisColorMode": "text",
            "axisLabel": "",
            "axisPlacement": "auto",
            "barAlignment": 0,
            "drawStyle": "bars",
            "fillOpacity": 100,
            "gradientMode": "hue",
            "hideFrom": {
              "legend": false,
              "tooltip": false,
              "viz": false
            },
            "insertNulls": false,
            "lineInterpolation": "linear",
            "lineWidth": 1,
            "pointSize": 5,
            "scaleDistribution": {
              "type": "linear"
            },
            "showPoints": "auto",
            "spanNulls": false,
            "stacking": {
              "group": "A",
              "mode": "normal"
            },
            "thresholdsStyle": {
              "mode": "off"
            }
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "green",
                "value": null
              },
              {
                "color": "red",
                "value": 80
              }
            ]
          }
        },
        "overrides": []
      },
      "gridPos": {
        "h": 7,
        "w": 24,
        "x": 0,
        "y": 0
      },
      "id": 10,
      "interval": "",
      "options": {
        "legend": {
          "calcs": [
            "mean",
            "max",
            "sum"
          ],
          "displayMode": "table",
          "placement": "right",
          "showLegend": true
        },
        "tooltip": {
          "mode": "single",
          "sort": "none"
        }
      },
      "pluginVersion": "10.1.4",
      "targets": [
        {
          "alias": "Info",
          "datasource": {
            "type": "influxdb",
            "uid": "${DS_INFLUXDB_HUBITAT2}"
          },
          "groupBy": [
            {
              "params": [
                "1m"
              ],
              "type": "time"
            },
            {
              "params": [
                "null"
              ],
              "type": "fill"
            }
          ],
          "measurement": "syslog",
          "orderByTime": "ASC",
          "policy": "default",
          "refId": "A",
          "resultFormat": "time_series",
          "select": [
            [
              {
                "params": [
                  "severity_code"
                ],
                "type": "field"
              },
              {
                "params": [],
                "type": "count"
              }
            ]
          ],
          "tags": [
            {
              "key": "severity",
              "operator": "=",
              "value": "info"
            },
            {
              "condition": "AND",
              "key": "hostname",
              "operator": "=~",
              "value": "/^$hostname$/"
            },
            {
              "condition": "AND",
              "key": "severity",
              "operator": "=~",
              "value": "/^$severity$/"
            },
            {
              "condition": "AND",
              "key": "appname",
              "operator": "=~",
              "value": "/^$appname$/"
            },
            {
              "condition": "AND",
              "key": "message",
              "operator": "=~",
              "value": "/$Query/"
            }
          ]
        },
        {
          "alias": "Notice",
          "datasource": {
            "type": "influxdb",
            "uid": "${DS_INFLUXDB_HUBITAT2}"
          },
          "groupBy": [
            {
              "params": [
                "1m"
              ],
              "type": "time"
            },
            {
              "params": [
                "null"
              ],
              "type": "fill"
            }
          ],
          "measurement": "syslog",
          "orderByTime": "ASC",
          "policy": "default",
          "refId": "B",
          "resultFormat": "time_series",
          "select": [
            [
              {
                "params": [
                  "severity_code"
                ],
                "type": "field"
              },
              {
                "params": [],
                "type": "count"
              }
            ]
          ],
          "tags": [
            {
              "key": "severity",
              "operator": "=",
              "value": "notice"
            },
            {
              "condition": "AND",
              "key": "hostname",
              "operator": "=~",
              "value": "/^$hostname$/"
            },
            {
              "condition": "AND",
              "key": "severity",
              "operator": "=~",
              "value": "/^$severity$/"
            },
            {
              "condition": "AND",
              "key": "appname",
              "operator": "=~",
              "value": "/^$appname$/"
            },
            {
              "condition": "AND",
              "key": "message",
              "operator": "=~",
              "value": "/$Query/"
            }
          ]
        },
        {
          "alias": "Warning",
          "datasource": {
            "type": "influxdb",
            "uid": "${DS_INFLUXDB_HUBITAT2}"
          },
          "groupBy": [
            {
              "params": [
                "1m"
              ],
              "type": "time"
            },
            {
              "params": [
                "null"
              ],
              "type": "fill"
            }
          ],
          "measurement": "syslog",
          "orderByTime": "ASC",
          "policy": "default",
          "refId": "D",
          "resultFormat": "time_series",
          "select": [
            [
              {
                "params": [
                  "severity_code"
                ],
                "type": "field"
              },
              {
                "params": [],
                "type": "count"
              }
            ]
          ],
          "tags": [
            {
              "key": "severity",
              "operator": "=",
              "value": "warning"
            },
            {
              "condition": "AND",
              "key": "hostname",
              "operator": "=~",
              "value": "/^$hostname$/"
            },
            {
              "condition": "AND",
              "key": "severity",
              "operator": "=~",
              "value": "/^$severity$/"
            },
            {
              "condition": "AND",
              "key": "appname",
              "operator": "=~",
              "value": "/^$appname$/"
            },
            {
              "condition": "AND",
              "key": "message",
              "operator": "=~",
              "value": "/$Query/"
            }
          ]
        },
        {
          "alias": "Error",
          "datasource": {
            "type": "influxdb",
            "uid": "${DS_INFLUXDB_HUBITAT2}"
          },
          "groupBy": [
            {
              "params": [
                "1m"
              ],
              "type": "time"
            },
            {
              "params": [
                "null"
              ],
              "type": "fill"
            }
          ],
          "measurement": "syslog",
          "orderByTime": "ASC",
          "policy": "default",
          "refId": "C",
          "resultFormat": "time_series",
          "select": [
            [
              {
                "params": [
                  "severity_code"
                ],
                "type": "field"
              },
              {
                "params": [],
                "type": "count"
              }
            ]
          ],
          "tags": [
            {
              "key": "severity",
              "operator": "=",
              "value": "err"
            },
            {
              "condition": "AND",
              "key": "hostname",
              "operator": "=~",
              "value": "/^$hostname$/"
            },
            {
              "condition": "AND",
              "key": "severity",
              "operator": "=~",
              "value": "/^$severity$/"
            },
            {
              "condition": "AND",
              "key": "appname",
              "operator": "=~",
              "value": "/^$appname$/"
            },
            {
              "condition": "AND",
              "key": "message",
              "operator": "=~",
              "value": "/$Query/"
            }
          ]
        },
        {
          "alias": "Critical",
          "datasource": {
            "type": "influxdb",
            "uid": "${DS_INFLUXDB_HUBITAT2}"
          },
          "groupBy": [
            {
              "params": [
                "1m"
              ],
              "type": "time"
            },
            {
              "params": [
                "null"
              ],
              "type": "fill"
            }
          ],
          "measurement": "syslog",
          "orderByTime": "ASC",
          "policy": "default",
          "refId": "E",
          "resultFormat": "time_series",
          "select": [
            [
              {
                "params": [
                  "severity_code"
                ],
                "type": "field"
              },
              {
                "params": [],
                "type": "count"
              }
            ]
          ],
          "tags": [
            {
              "key": "severity",
              "operator": "=",
              "value": "crit"
            },
            {
              "condition": "AND",
              "key": "hostname",
              "operator": "=~",
              "value": "/^$hostname$/"
            },
            {
              "condition": "AND",
              "key": "severity",
              "operator": "=~",
              "value": "/^$severity$/"
            },
            {
              "condition": "AND",
              "key": "appname",
              "operator": "=~",
              "value": "/^$appname$/"
            },
            {
              "condition": "AND",
              "key": "message",
              "operator": "=~",
              "value": "/$Query/"
            }
          ]
        },
        {
          "alias": "Alert",
          "datasource": {
            "type": "influxdb",
            "uid": "${DS_INFLUXDB_HUBITAT2}"
          },
          "groupBy": [
            {
              "params": [
                "1m"
              ],
              "type": "time"
            },
            {
              "params": [
                "null"
              ],
              "type": "fill"
            }
          ],
          "measurement": "syslog",
          "orderByTime": "ASC",
          "policy": "default",
          "refId": "F",
          "resultFormat": "time_series",
          "select": [
            [
              {
                "params": [
                  "severity_code"
                ],
                "type": "field"
              },
              {
                "params": [],
                "type": "count"
              }
            ]
          ],
          "tags": [
            {
              "key": "severity",
              "operator": "=",
              "value": "alert"
            },
            {
              "condition": "AND",
              "key": "hostname",
              "operator": "=~",
              "value": "/^$hostname$/"
            },
            {
              "condition": "AND",
              "key": "severity",
              "operator": "=~",
              "value": "/^$severity$/"
            },
            {
              "condition": "AND",
              "key": "appname",
              "operator": "=~",
              "value": "/^$appname$/"
            },
            {
              "condition": "AND",
              "key": "message",
              "operator": "=~",
              "value": "/$Query/"
            }
          ]
        },
        {
          "alias": "Debug",
          "datasource": {
            "type": "influxdb",
            "uid": "${DS_INFLUXDB_HUBITAT2}"
          },
          "groupBy": [
            {
              "params": [
                "1m"
              ],
              "type": "time"
            },
            {
              "params": [
                "null"
              ],
              "type": "fill"
            }
          ],
          "measurement": "syslog",
          "orderByTime": "ASC",
          "policy": "default",
          "refId": "G",
          "resultFormat": "time_series",
          "select": [
            [
              {
                "params": [
                  "severity_code"
                ],
                "type": "field"
              },
              {
                "params": [],
                "type": "count"
              }
            ]
          ],
          "tags": [
            {
              "key": "severity",
              "operator": "=",
              "value": "debug"
            },
            {
              "condition": "AND",
              "key": "hostname",
              "operator": "=~",
              "value": "/^$hostname$/"
            },
            {
              "condition": "AND",
              "key": "severity",
              "operator": "=~",
              "value": "/^$severity$/"
            },
            {
              "condition": "AND",
              "key": "appname",
              "operator": "=~",
              "value": "/^$appname$/"
            },
            {
              "condition": "AND",
              "key": "message",
              "operator": "=~",
              "value": "/$Query/"
            }
          ]
        }
      ],
      "title": "syslog count",
      "type": "timeseries"
    },
    {
      "datasource": {
        "type": "influxdb",
        "uid": "${DS_INFLUXDB_HUBITAT2}"
      },
      "description": "",
      "fieldConfig": {
        "defaults": {
          "color": {
            "mode": "thresholds"
          },
          "custom": {
            "align": "left",
            "cellOptions": {
              "type": "auto"
            },
            "filterable": false,
            "inspect": true
          },
          "mappings": [],
          "thresholds": {
            "mode": "absolute",
            "steps": [
              {
                "color": "dark-purple",
                "value": null
              },
              {
                "color": "dark-red",
                "value": 2
              },
              {
                "color": "dark-orange",
                "value": 3
              },
              {
                "color": "dark-yellow",
                "value": 4
              },
              {
                "color": "rgb(150, 150, 150)",
                "value": 5
              },
              {
                "color": "rgb(51, 51, 51)",
                "value": 6
              },
              {
                "color": "rgb(5, 5, 5)",
                "value": 7
              }
            ]
          }
        },
        "overrides": [
          {
            "matcher": {
              "id": "byName",
              "options": "severity_code"
            },
            "properties": [
              {
                "id": "mappings",
                "value": [
                  {
                    "options": {
                      "0": {
                        "text": "Emergency"
                      },
                      "1": {
                        "text": "Alert"
                      },
                      "2": {
                        "text": "Critical"
                      },
                      "3": {
                        "text": "Error"
                      },
                      "4": {
                        "text": "Warning"
                      },
                      "5": {
                        "text": "Notice"
                      },
                      "6": {
                        "text": "Info"
                      },
                      "7": {
                        "text": "Debug"
                      }
                    },
                    "type": "value"
                  }
                ]
              },
              {
                "id": "custom.cellOptions",
                "value": {
                  "mode": "gradient",
                  "type": "color-background"
                }
              },
              {
                "id": "custom.width",
                "value": 119
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "Time"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 163
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "hostname"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 194
              }
            ]
          },
          {
            "matcher": {
              "id": "byName",
              "options": "appname"
            },
            "properties": [
              {
                "id": "custom.width",
                "value": 330
              }
            ]
          }
        ]
      },
      "gridPos": {
        "h": 24,
        "w": 24,
        "x": 0,
        "y": 7
      },
      "id": 12,
      "options": {
        "cellHeight": "sm",
        "footer": {
          "countRows": false,
          "fields": "",
          "reducer": [
            "sum"
          ],
          "show": false
        },
        "showHeader": true,
        "sortBy": [
          {
            "desc": true,
            "displayName": "Time"
          }
        ]
      },
      "pluginVersion": "10.4.5",
      "targets": [
        {
          "datasource": {
            "type": "influxdb",
            "uid": "${DS_INFLUXDB_HUBITAT2}"
          },
          "groupBy": [
            {
              "params": [
                "hostname"
              ],
              "type": "tag"
            },
            {
              "params": [
                "appname"
              ],
              "type": "tag"
            }
          ],
          "measurement": "syslog",
          "orderByTime": "ASC",
          "policy": "default",
          "refId": "A",
          "resultFormat": "table",
          "select": [
            [
              {
                "params": [
                  "severity_code"
                ],
                "type": "field"
              }
            ],
            [
              {
                "params": [
                  "message"
                ],
                "type": "field"
              }
            ]
          ],
          "tags": [
            {
              "key": "hostname",
              "operator": "=~",
              "value": "/^$hostname$/"
            },
            {
              "condition": "AND",
              "key": "appname",
              "operator": "=~",
              "value": "/^$appname$/"
            },
            {
              "condition": "AND",
              "key": "severity",
              "operator": "=~",
              "value": "/^$severity$/"
            },
            {
              "condition": "AND",
              "key": "message",
              "operator": "=~",
              "value": "/$Query/"
            }
          ]
        }
      ],
      "title": "Syslog Messages",
      "type": "table"
    }
  ],
  "refresh": "",
  "revision": 1,
  "schemaVersion": 39,
  "tags": [],
  "templating": {
    "list": [
      {
        "allValue": "",
        "current": {},
        "datasource": {
          "type": "influxdb",
          "uid": "${DS_INFLUXDB_HUBITAT2}"
        },
        "definition": "SHOW TAG VALUES FROM syslog WITH KEY=appname",
        "hide": 0,
        "includeAll": true,
        "label": "Appname",
        "multi": true,
        "name": "appname",
        "options": [],
        "query": "SHOW TAG VALUES FROM syslog WITH KEY=appname",
        "refresh": 2,
        "regex": "",
        "skipUrlSync": false,
        "sort": 1,
        "tagValuesQuery": "",
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      },
      {
        "allValue": "",
        "current": {},
        "datasource": {
          "type": "influxdb",
          "uid": "${DS_INFLUXDB_HUBITAT2}"
        },
        "definition": "SHOW TAG VALUES FROM syslog WITH KEY=hostname",
        "hide": 0,
        "includeAll": true,
        "label": "Hostname",
        "multi": true,
        "name": "hostname",
        "options": [],
        "query": "SHOW TAG VALUES FROM syslog WITH KEY=hostname",
        "refresh": 2,
        "regex": "",
        "skipUrlSync": false,
        "sort": 1,
        "tagValuesQuery": "",
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      },
      {
        "allValue": "",
        "current": {},
        "datasource": {
          "type": "influxdb",
          "uid": "${DS_INFLUXDB_HUBITAT2}"
        },
        "definition": "SHOW TAG VALUES FROM syslog WITH KEY=severity",
        "hide": 0,
        "includeAll": true,
        "label": "Severity",
        "multi": true,
        "name": "severity",
        "options": [],
        "query": "SHOW TAG VALUES FROM syslog WITH KEY=severity",
        "refresh": 2,
        "regex": "",
        "skipUrlSync": false,
        "sort": 0,
        "tagValuesQuery": "",
        "tagsQuery": "",
        "type": "query",
        "useTags": false
      },
      {
        "current": {
          "selected": false,
          "text": "",
          "value": ""
        },
        "description": "Querystring",
        "hide": 0,
        "label": "MessageQuery",
        "name": "Query",
        "options": [
          {
            "selected": true,
            "text": "",
            "value": ""
          }
        ],
        "query": "",
        "skipUrlSync": false,
        "type": "textbox"
      }
    ]
  },
  "time": {
    "from": "now-1h",
    "to": "now"
  },
  "timepicker": {
    "refresh_intervals": [
      "5s",
      " 10s",
      " 30s",
      " 1m",
      " 5m"
    ],
    "time_options": [
      "5m",
      "15m",
      "1h",
      "6h",
      "12h",
      "24h",
      "2d",
      "7d",
      "30d"
    ]
  },
  "timezone": "",
  "title": "Syslog",
  "uid": "cbdb07f7-6b6d-46f5-8e6c-4cd9dabf796e",
  "version": 2,
  "weekStart": ""
}
2 Likes

Thanks all for all your suggestions!

4 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.