Logger filters does not work properly

Hello.
I really don’t know if there is a problem with logger filters or maybe I don’t know how to use is properly… (not enough information here Logger - Home Assistant).
I’m trying to set a global logger to Warning level but I don’t want to see specific warnings and errors from ddwrt component and my chromecast audio devices.

My warning/errors:

2021-12-02 22:04:06 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved
2021-12-02 22:04:13 WARNING (Thread-7) [pychromecast.socket_client] [WSZYSTKIE GŁOŚNIKI(192.168.1.45):32100] Heartbeat timeout, resetting connection

And here is my logger configuration from configuration.yaml.
As you can see I’ve tried many different options but it does not work.

logger:
  default: warning
  logs:
    custom_components.my_integration: critical
  filters:
    homeassistant.components.ddwrt: #e.g. components/ddwrt/device_tracker.py:145
      - "Task exception was never retrieved"
    ddwrt:
      - "Task exception was never retrieved"
    homeassistant.components.google_assistant:
      - "Heartbeat timeout, resetting connection"
      - "Error reading from socket"
      - "Error communicating with socket, resetting connection"
      - "Failed to connect to service ServiceInfo"
    google_assistant:
      - "Heartbeat timeout, resetting connection"
      - "Error reading from socket"
      - "Error communicating with socket, resetting connection"
      - "Failed to connect to service ServiceInfo"
    homeassistant.components.pychromecast:
      - "Heartbeat timeout, resetting connection"
      - "Error reading from socket"
      - "Error communicating with socket, resetting connection"
      - "Failed to connect to service ServiceInfo"
    pychromecast: #e.g. /usr/local/lib/python3.9/site-packages/pychromecast/socket_client.py:650
      - "Heartbeat timeout, resetting connection"
      - "Error reading from socket"
      - "Error communicating with socket, resetting connection"
      - "Failed to connect to service ServiceInfo"

Could you please advise?

2 Likes
logs:
filters:
  pychromecast.socket_client: 
    - "blabblabla"

Thank you tomdudu38 !

Looks like I need to put .py file name to make it works. Didn’t expect this.
I was sure that specific component name is enough.

1 Like

@tomdudu38 I’ve marked your response as a solution but actually it is a partially solution.
Indeed it helps with chromecast errors but what about error from ddwrt?

In first post you can see that I’ve tried

  filters:
    homeassistant.components.ddwrt: #e.g. components/ddwrt/device_tracker.py:145
      - "Task exception was never retrieved"
    ddwrt:
      - "Task exception was never retrieved"

And yesterday I was sure that I need to add “device_tracker” but still does not work…

    homeassistant.components.ddwrt.device_tracker:
      - "Task exception was never retrieved"
    ddwrt.device_tracker:
      - "Task exception was never retrieved"
    urllib3.connection:
      - "Task exception was never retrieved"

Any suggestion how to get rid of

@EDIT
Last try from today:

    components.ddwrt.device_tracker:
      - "Task exception was never retrieved"

I will update this topic later with results. No more idea how to catch this error in logger filters.

@EDIT2:
Nope… it does not work.

2 Likes

hi sorry i don’t know, i would try:
custom_components.ddwrt:
custom_components.ddwrt.device_tracker:

Thank you @tomdudu38 ! You are awesome!
Looks like it is working.

It doesn’t matter that ddwrt is normal component (even in logs we can see INFO (SyncWorker_0) [homeassistant.loader] Loaded ddwrt from homeassistant.components.ddwrt)…

Solution for ddwrt error:

    custom_components.ddwrt:
      - "Task exception was never retrieved"

Solution for google devices errors:

    pychromecast.socket_client:
      - "Heartbeat timeout, resetting connection"
      - "Error reading from socket"
      - "Error communicating with socket, resetting connection"
      - "Failed to connect to service ServiceInfo"
3 Likes

I’m really sorry for confusion.
I have installed few google devices and when those devices are updating themself (mostly at night), they are unavailable. This is the reason of pychromecast errors.
My ddwrt component is scaning the network every 30 sec. When ddwrt is trying to ping google devices when they are updating, the error appear. I’ve changed it (scanning) to 60sec and when I put logger filter to “custom_components.ddwrt” I haven’t received any errors from ddwrt. This was premature joy. I totaly forgot that I changed scanning to 60sec.
Updating google devices tooks less than 1 min and ddwrt have not tried to scan them during updating so no errors appear…

Looks like logger filter for ddwrt does not work. I’ve opened a ticket for this problem Logger filter ignores ddwrt component · Issue #61485 · home-assistant/core · GitHub

1 Like