When you are having an issue with an integration, one of the more useful steps is to change it’s log level to debug. Users are often asked to do this and share the logs in issues but doing this may avoid the need to make an issue in the first place if the debug log shows what’s wrong.
This can be done quickly and easily without a restart but it’s rather hidden.
You have to find the info on the set level service and recognize that you can simply call services from developer tools
You have to figure out which loggers to set to debug
#3 in particular is very tricky. Devs know that the logger you probably want to set to debug is homeassistant.components.<integration name>. But it doesn’t really say that anywhere and sometimes there are other loggers that can be useful to set to debug (like for a particular library the integration depends on with good logging).
It would be useful if integrations listed the loggers they used or an example service call in the doc. Or if there was a UI way to turn on and off debug logging on all the loggers of an integration without users needing to make these service calls.
It would be lovely if through the frontend that you could click on an integration and then turn on debug logs for the integration as well as its dependent library. The number of time I have had to explain how to do this for the integrations I’ve written…
If there was a configuration page for each integration, similar to the configuration page for each device, there would be room, to show current version, current logging level, options to change logging, whether it was loaded via the UI or YAML.
Huh, you might have to add logger: to your configuration.yaml to load logger. I assumed it was part of default_config but I see now that it is not. I’ve always had it in there to set the default log level so I never realized that was required. I guess add another step to the list.
I guess. You only have to do it exactly one time though. You can just leave logger: in there after that, it doesn’t do anything except cause the service to be loaded. It’s not really a source of repeated restarts.
Neither (probably). If logger was added to default_config and you have default_config: in your configuration.yaml then you would see the logger services. Default config is not based on when you first started up HA, it loads the list of integrations here on startup. If an update to HA adds or removes integrations from that list then that also changes for you after you apply the update.
It might be a bug. Although that list is pretty carefully curated so its much more likely a feature request. I may not know the reason but I highly doubt it was accidentally omitted or removed.
The result will be that logger.set_level and logger.set_defaul_level will be available as a service to all configurations. So the logger docs will wind up becoming correct
Note/warning: In the current release of HA if you just add logger: without setting the default level to your config, it will set the default log level to debug.