From eb656299f439364c317a92ad450fb31b4beb3bfa Mon Sep 17 00:00:00 2001 From: Jacob Shufro Date: Sun, 28 Mar 2021 13:34:45 -0400 Subject: [PATCH 1/2] Add documentation for logger regex filters --- source/_integrations/logger.markdown | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/source/_integrations/logger.markdown b/source/_integrations/logger.markdown index e61bca4380a6..a30fbd496861 100644 --- a/source/_integrations/logger.markdown +++ b/source/_integrations/logger.markdown @@ -88,6 +88,14 @@ where **namespace** is the ** currently logging. '<component_namespace>': description: Logger namespace of the component. See [log_level](#log-levels). type: string + filters: + description: Regular Expression logging filters. + required: false + type: map + keys: + '<component_namespace>': + 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 config 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` From d410dce31dc13ad3080b1d37409a168f214176bb Mon Sep 17 00:00:00 2001 From: Franck Nijhof Date: Mon, 29 Mar 2021 09:05:35 +0200 Subject: [PATCH 2/2] Tweak --- source/_integrations/logger.markdown | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/_integrations/logger.markdown b/source/_integrations/logger.markdown index a30fbd496861..e01a2f98dbf9 100644 --- a/source/_integrations/logger.markdown +++ b/source/_integrations/logger.markdown @@ -122,7 +122,7 @@ Possible log severity levels, listed in order from most severe to least severe, Service-specific Regular Expression filters for logs. A message is omitted if it matches the Regular Expression. -An example config might look like this: +An example configuration might look like this: ```yaml # Example configuration.yaml entry