From f409e414a63f8fb214171612c7a90b59e4671bde Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20=C4=8Cerm=C3=A1k?= Date: Thu, 25 Apr 2024 10:46:14 +0200 Subject: [PATCH] Document "Accept: text/x-log" in Supervisor host logs API (#2123) This was added in https://github.com/home-assistant/supervisor/pull/4963 and available since Supervisor 2024.03.1. --- docs/api/supervisor/endpoints.md | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/docs/api/supervisor/endpoints.md b/docs/api/supervisor/endpoints.md index 51adbd01..e13a1484 100644 --- a/docs/api/supervisor/endpoints.md +++ b/docs/api/supervisor/endpoints.md @@ -1557,9 +1557,9 @@ log record per line. **HTTP Request Headers** -| Header | optional | description | -| -------- | -------- | ---------------------------------------------- | -| Accept | true | Type of data (currently only text/plain) | +| Header | optional | description | +| -------- | -------- |-------------------------------------------------------------------------------| +| Accept | true | Type of data (text/plain or text/x-log) | | Range | true | Range of log entries. The format is `entries=cursor[[:num_skip]:num_entries]` | :::tip @@ -1571,6 +1571,11 @@ as `num_skip`. E.g. `Range: entries=:-9:` returns the last 10 entries. Or API returns the last 100 lines by default. Provide a value for `Range` to see logs further in the past. +The `Accept` header can be set to `text/x-log` to get logs annotated with +extra information, such as the timestamp and Systemd unit name. If no +identifier is specified (i.e. for the host logs containing logs for multiple +identifiers/units), this option is ignored - these logs are always annotated. +