Skip to content

Commit

Permalink
mention the hierarchical namespace for logging
Browse files Browse the repository at this point in the history
  • Loading branch information
ghoz committed Jun 3, 2024
1 parent 20fe242 commit bc87341
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions docs/guide/configuration/logging.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ The log-level can be adjusted at runtime, see [MQTT Topics and Messages](../usag
advanced:
# Optional: Logging level, options: debug, info, warning, error (default: info)
log_level: info
# Optional: Set individual log levels for certain namespaces (default: {})
# Optional: Set log levels for certain namespaces hierarchies (default: {})
log_namespaced_levels:
z2m:mqtt: warning
# Optional: log timestamp format (default: shown below)
Expand Down Expand Up @@ -53,9 +53,25 @@ Logging can have a significant impact on MQTT traffic. For that reason, only `in
advanced:
log_level: info
log_namespaced_levels:
z2m:mqtt: warning
'z2m:mqtt': warning
```

## Defining levels for specific namespace hierarchy
The log levels defined in `log_namespaced_levels` will apply to the namespace itself and all namespaces below unless explicitely configured.
In addition to the regex based debug filter [#preventing-specific-namespaces-from-being-logged] it allows to fine tune your logging needs to great detail.
```yaml
advanced:
log_level: warning
log_namespaced_levels:
'zhc': info
'zhc:legacy:fz' : debug
```

- All namespaces bellow `zhc` will be logged as info
- Except all namespaces bellow `zhc:legacy:fz` that will be logged as debug
- All the rest uses the `warning` level`


## Debugging

In case Zigbee2MQTT isn't working as expected the following tips can help you in finding the problem.
Expand Down

0 comments on commit bc87341

Please sign in to comment.