To the point, it would be awesome to have the logger integration support regex or substring-based log filtering. This would allow users to suppress specific log warnings and errors. Albeit, I’ve not a clue on how difficult a task this would be to accomplish. I’ve come to this idea having spent the last month doing “house cleaning” on my Home Assistant OS to fix legitimate issues and reduce log clutter.
More specifically, my use case is suppressing network timeout warnings and errors. I’ve several devices that get these timeout logs because they are on a vlan and/or are specifically blocked at my router from accessing the internet and/or their DNS probing is being rewritten/redirected. The devices work great despite my best efforts to secure them locally and prevent them from phoning home, but I get timeouts in the logs.
Some devices I have getting timeout errors include -
TP-link Kasa (older generation switches, plugs, and bulbs that don’t have matter support and have been commissioned locally using python and are blocked from accessing internet and DNS rewritten)
Broadlink IR/RF-blasters (blocked from internet and DNS rewritten)
Amazon Firesticks/Fire Cubes using the Android Debug Bridge integration (on a vlan network)
I know some filtering can be done, but they’re generalized. I can filter all warnings and just show critical, errors, and info. Or I can filter all errors and show everything else. What I’m asking for is support to filter out “specific” errors and warnings.
The broadlink devices still try to probe DNS to phone home despite using the core integration. You can see the DNS requests if you’re using something like pihole, AdGuard Home, or wireshark.
filters:
# Errors resulting from TV being switched off
homeassistant.components.androidtv.entity:
- "Failed to execute an ADB command*"
homeassistant.components.androidtv.media_player:
- "Failed to execute an ADB command*"
Or the example in the docs:
filters:
custom_components.my_integration:
- "HTTP 429" # Filter all HTTP 429 errors
- "Request to .*unreliable.com.* Timed Out"