mirror of
https://github.com/home-assistant/home-assistant.io.git
synced 2025-07-21 08:16:53 +00:00
Fix double double quotes in example + style tables (#28135)
This commit is contained in:
parent
b5f796382a
commit
518c097ba7
@ -43,23 +43,23 @@ To manually clear the system log, call this service.
|
||||
|
||||
Write a log entry
|
||||
|
||||
| Service data attribute | Optional | Description |
|
||||
| ---------------------- | -------- | ------------------------------------------------------------------------------- |
|
||||
| `message` | no | Message to log |
|
||||
| `level` | yes | Log level: debug, info, warning, error, critical. Defaults to 'error'. |
|
||||
| `logger` | yes | Logger name under which to log the message. Defaults to 'system_log.external'. |
|
||||
| Service data attribute | Optional | Description |
|
||||
| ---------------------- | -------- | ------------------------------------------------------------------------------ |
|
||||
| `message` | no | Message to log |
|
||||
| `level` | yes | Log level: debug, info, warning, error, critical. Defaults to 'error'. |
|
||||
| `logger` | yes | Logger name under which to log the message. Defaults to 'system_log.external'. |
|
||||
|
||||
## Events
|
||||
|
||||
Errors and warnings are posted as the event `system_log_event`, so it is possible to write automations that trigger whenever a warning or error occurs. The following information is included in each event:
|
||||
|
||||
| Field | Description |
|
||||
|-------------|-----------------------------------------------------------------------------|
|
||||
| ----------- | --------------------------------------------------------------------------- |
|
||||
| `level` | Either `WARNING` or `ERROR` depending on severity. |
|
||||
| `source` | File that triggered the error, e.g., `core.py` or `media_player/yamaha.py`. |
|
||||
| `exception` | Full stack trace if available, an empty string otherwise. |
|
||||
| `message` | Descriptive message of the error, e.g., "Error handling request". |
|
||||
| `name` | Name of the integration, e.g., `homeassistant.components.device_tracker` |
|
||||
| `name` | Name of the integration, e.g., `homeassistant.components.device_tracker` |
|
||||
| `timestamp` | Unix timestamp with as a double, e.g., 1517241010.237416. |
|
||||
|
||||
Live examples of these events can be found in the Home Assistant log file (`home-assistant.log`) or by just looking in the system log. An example could, for instance, look like this:
|
||||
@ -109,7 +109,7 @@ This automation will create a persistent notification whenever an error or warni
|
||||
|
||||
```yaml
|
||||
automation:
|
||||
- alias: "Create notifications for "service" errors"
|
||||
- alias: "Create notifications for 'service' errors"
|
||||
trigger:
|
||||
platform: event
|
||||
event_type: system_log_event
|
||||
|
Loading…
x
Reference in New Issue
Block a user