Skip to content

Commit

Permalink
mention the hierarchical namespace for logging (#2786)
Browse files Browse the repository at this point in the history
* mention the hierarchical namespace for logging

Documents Koenkk/zigbee2mqtt#22859

* fix wording according to review
  • Loading branch information
ghoz committed Jun 4, 2024
1 parent d9c5ad3 commit 5fbfa80
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion 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 @@ -56,6 +56,22 @@ advanced:
z2m:mqtt: warning
```

## Defining levels for specific namespace hierarchy
Any log level defined in `log_namespaced_levels` will apply to the namespace itself and all namespaces below it, unless explicitly configured.

```yaml
advanced:
log_level: warning
log_namespaced_levels:
zhc: info
zhc:legacy:fz: debug
```

- `zhc` and below namespaces will be logged as `info` (examples: `zhc`, `zhc:ota:common`, `zhc:legacy:tz`)
- `zhc:legacy:fz` and below namespaces will be logged as `debug` (examples: `zhc:legacy:fz`, `zhc:legacy:fz:tuya`)
- Other unspecified namespaces will use `log_level`, in this case, `warning` (examples: `z2m:mqtt`, `zh:zstack`)


## 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 5fbfa80

Please sign in to comment.