WTH why do we need to restart HA core so much?

If I want to change logging levels, to temporarily investigate something, two HA restarts are needed last I checked, (The 2nd one is need3d to turn logging back down).

no, you can change logging levels with a service.

2 Likes

Thanks - I hadn’t seen that. There is documentation, like the MQTT logging page, that only show changing logging via configuration entries. MQTT Logging - Home Assistant

(Note the MQTT logging page is linked from the list of topics on the right hand side of all docs pages, so it isn’t exactly an obscure documentation reference.)

home assistant docs are separated per integration. If you want to read up on logger functionality, you go to the logger integration docs, not the MQTT integrations docs.

Totally correct. That being said, this is kinda a WTH IMO. Debug logging is a handy tool to have in your toolkit when facing issues and it currently requires a lot of insider knowledge to turn it on.

I made a separate WTH about this @rct . It’s not a restart issue so it’s off topic here but I agree it is unnecessarily confusing.

1 Like

This doesn’t seem to work for me. Don’t know if it is a bug in 2022.9.x.

Was logger been added to default_config or is the need to add it to your config missing from Logger - Home Assistant ?

In any case for me it appears logging level changes still requires an HA restart for me.

You have to have logger: in configuration.yaml

I was going to mention that, this is the only drawback and not so clear in the docs that you need to do it for the services to work, when I ask people for logs I do ask them to add the loggers to configuration.yaml and restart core mainly because I don’t know if they have it already.
I wonder if we can convert the logger to config flow so it would be possible just to add it and maybe even select components from the UI… I will try to discuss it with other members.

1 Like

Thanks. So your earlier post wasn’t quite correct, as at least one restart is needed (after you figure all of this out).

Would it be possible to have a reload configuration option that rescans the configuration files and loads new integrations that haven’t previously been loaded?

I understand the issue that reload support is needed in each integration for a reload everything to work. However, if an integration hasn’t been loaded yet, that problem wouldn’t apply and possibly a few restarts could be avoided.

Well I think this would be easiest tbh:

I can’t really think of any reason why it wouldn’t be in default config. Then everyone would just have the service.

That being said a test did fail so maybe there is a reason. Setting up my devcontainer to find out why it doesn’t like that now.

2 Likes

@CentralCommand write me on discord if you need help with debugging the tests

I’m fairly sure it can be. But not sure why it’s not included in default_config.

@CentralCommand Thats good as long as people can ADD logger: without having to ditch default_config: and split it.

1 Like

This should always work as far as I know you can override the default but can’t remove things from the default

1 Like

I wasn’t sure, I don’t use it so the functionality has always been somewhat of a mystery to me.

Yea it works like that. Otherwise no one would have default_config in their configuration.yaml because it lists automation, script and scene. The OOTB configuration wouldn’t even work then since it has this:

default_config:
automation: !include automations.yaml
script: !include scripts.yaml
scene: !include scenes.yaml
2 Likes

What annoys me that we not only have to restart it a lot, but that it is also done very abruptly, crashing all automations, timers etc. That can mess up many things at home, if HA runs deep.