Logger levels not working?

I have set the following in configuration.yaml

  default: critical
    homeassistant.components.sensor: error
    homeassistant.components.mqtt: error

yet the logfile is flooded with messages like this:

020-10-02 09:24:07 DEBUG (MainThread) [homeassistant.components.mqtt] Received message on ...
2020-10-02 09:24:32 WARNING (MainThread) [homeassistant.components.sensor] Updating  ....

I thought I wasn’t supposed to see those according to the loglevels found here: https://www.home-assistant.io/integrations/logger/

What am I missing?

Please, don’t hold back in telling me I’m doing something stupid.

Did you restart HA after changing the log level ?

:slightly_smiling_face: I did. Several times even.

I don’t see anything wrong with your config. Check setting it at runtime using logger.set_level as described in the docs and see if that helps, or perhaps provides additional logging to understand what’s going on.

I’ve noticed a similar problem after fiddling with the logs recently. Even after removing the logger: section entirely from the yaml (and rebooting, several times), my logs are still flooded with debug messages. I’m still at the beginning of trying to figure this out but wanted to post here in case there are any updates.

EDIT: I’m running the container, removing and rebuilding it got the default logs working again where restarting (either via the HA UI or docker restart) didn’t before. I also tried deleting my home-assistant_v2.db file before recreating the container, not sure if that was necessary or not.

Check setting it at runtime using logger.set_level as described in the docs and see if that helps

Unfortunately no.

or perhaps provides additional logging to understand what’s going on.

What logging would you like to see ? there are no errors or anything logged as far5 as I van see.

Experiencing the same.


  default: error
    homeassistant.components.tuya: fatal

Log Details (ERROR)

Logger: homeassistant.helpers.entity
Source: components/tuya/__init__.py:255
First occurred: 2:40:34 PM (16 occurrences)
Last logged: 3:06:34 PM

Update for switch.02200490dc4f221617c6 fails
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/helpers/entity.py", line 278, in async_update_ha_state
    await self.async_device_update()
  File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/helpers/entity.py", line 474, in async_device_update
    raise exc
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/components/tuya/__init__.py", line 255, in update
  File "/srv/homeassistant/lib/python3.7/site-packages/tuyaha/devices/switch.py", line 16, in update
    return self._update(use_discovery=True)
  File "/srv/homeassistant/lib/python3.7/site-packages/tuyaha/devices/base.py", line 84, in _update
    devices = self.api.discovery()
  File "/srv/homeassistant/lib/python3.7/site-packages/tuyaha/tuyaapi.py", line 188, in discovery
    response = self._request("Discovery", "discovery")
  File "/srv/homeassistant/lib/python3.7/site-packages/tuyaha/tuyaapi.py", line 268, in _request
    name, response_json["header"].get("msg", result_code), devId
  File "/srv/homeassistant/lib/python3.7/site-packages/tuyaha/tuyaapi.py", line 292, in _raise_frequently_invoke
    raise TuyaFrequentlyInvokeException(message)
tuyaha.tuyaapi.TuyaFrequentlyInvokeException: Method [Discovery] fails 1 time(s) using poll interval 60.0 - error: you can discovery once in 600 seconds

I have been having this problem for months and months… it seems that if at any time ive added a specific logging level to track something and then remove that config, it just stays at that level. So if my default level is ‘warning’, and i set a zha level to debug, and then i remove the zha setting, zha will stay at debug unless i explicitly set it to warning. My logs are FILLED with zigbee debug logs.

It doesn’t work.

I’ve got this:

  default: info
    homeassistant.components.androidtv_remote: critical

But I’m getting spammed in the logs by this. So much so it’s easier to just delete the device.