How Much Should I use Logs

Does having logs turned on use a lot of Hubitat Resources? What is the best practice, should I have all logs turned off unless I am having an issue or are there minimum group of ones to have on?

1 Like

it really matters on a device by device basis.. i leave ones one that only put out a line periodically. ones that spew out all kinds of stuff i leave off.. most are off. and i turn them on as needed..

2 Likes

Yeah, me too. That way, you can go back farther in time.

To add to the above, stock drivers normally provide options for two types of logging with different behaviors:

  1. "Debug logging," which is enabled by default for 30 minutes after the installation or creation of a new device (and also for 30 minutes if manually re-enabled). For drivers, this generally shows incoming messages to the device (e.g., what is being parsed--or not) and may help you troubleshoot things if the device is not behaving as expected (e.g., not generating an event on Hubitat when a real-world device "action" occurs), though often this will only make sense if you wrote the driver yourself and know what it should log when
  2. "Description text logging" or "info logging," which is enabled by default (indefinitely) and, by convention, will write an "info" line to the logs whenever the device generates an event--for example, "button 1 pushed," "motion active," or "switch is on."

Considering that the latter conventionally disables itself in 30 minutes, it's generally not a concern for me whether its on (since it usually turns itself off in a bit), and I only turn it on manually otherwise if I'm trying to troubleshoot something. The latter is a personal preference, but I tend to leave mine at the default of enabled. It's nice to see in the logs when device events (probably) happen--but it's nothing you can't get elsewhere, notably the authoritative "Events" tab on the actual device page. But I think seeing things in live or past logs is helpful. Your preferences may vary.

There is less of a standard for apps here. Some have options to enable or disable all logging or enable various "levels" of logging. I generally only enable something here if I'm trying to troubleshoot. Defaults vary but are usually minimal or off.

Finally, community drivers and apps can really do whatever they want. Well written (IMHO) ones generally follow the above conventions, but they are indeed just conventions (e.g., some people think that device events being written to the logs happens at a platform level; it does not).

To more specially answer your question, my understanding matches the above: we've generally been told by staff that there should be no impact from logging either way in normal use. If a device is going crazy or someone wrote an app that is truly spamming the logs (say, multiple entries per second), I'm not saying I wouldn't get concerned, though. :slight_smile: They did put a size limit on past logs, in part it seems to encourage developers to limit logging in regular use whenever possible, and that's something else that drives my decision to enable or disable various types of logging: if I come home, discover something odd, and what to troubleshoot something that happened two hours ago, would it be nice for that to still be in the past logs? The answer is often "yes," and then it's a balancing act between getting enough logging from the devices or apps I care about so that it's useful without being so much that they disappear before I get to them. :slight_smile:

2 Likes