Add documentation for logger regex filters (#17160)

* Add documentation for logger regex filters

* Tweak

Co-authored-by: Franck Nijhof <frenck@frenck.nl>
This commit is contained in:
Jacob Shufro 2021-03-30 12:53:18 -04:00 committed by GitHub
parent 208bb24714
commit 9d792b032d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -88,6 +88,14 @@ where **namespace** is the *<component_namespace>* currently logging.
'&lt;component_namespace&gt;':
description: Logger namespace of the component. See [log_level](#log-levels).
type: string
filters:
description: Regular Expression logging filters.
required: false
type: map
keys:
'&lt;component_namespace&gt;':
description: Logger namespace of the component and a list of Regular Expressions. See [Log Filters](#log-filters).
type: list
{% endconfiguration %}
In the example, do note the difference between 'glances_api' and 'homeassistant.components.glances' namespaces,
@ -110,6 +118,26 @@ Possible log severity levels, listed in order from most severe to least severe,
- debug
- notset
### Log Filters
Service-specific Regular Expression filters for logs. A message is omitted if it matches the Regular Expression.
An example configuration might look like this:
```yaml
# Example configuration.yaml entry
logger:
default: info
logs:
custom_components.my_integration: critical
filters:
custom_component.my_integartion:
- "HTTP 429" # Filter all HTTP 429 errors
- "Request to .*unreliable.com.* Timed Out"
homeassistant.components.nws:
- "^Error handling request$"
```
## Services
### Service `set_default_level`