mirror of
https://github.com/home-assistant/supervisor.git
synced 2025-04-19 18:57:16 +00:00

* Add enhanced logging REST endpoints using systemd-journal-gatewayd Add /host/logs/entries and /host/logs/{identifier}/entries to expose log entries from systemd-journald running on the host. Use systemd-journal-gatewayd which exposes the logs to the Supervisor via Unix socket. Current two query string parameters are allowed: "boot" and "follow". The first will only return logs since last boot. The second will keep the HTTP request open and send new log entries as they get added to the systemd-journal. * Allow Range header Forward the Range header to systemd-journal-gatewayd. This allows to select only a certain amount of log data. The Range header is a standard header to select only partial amount of data. However, the "entries=" prefix is custom for systemd-journal-gatewayd, denoting that the numbers following represent log entries (as opposed to bytes or other metrics). * Avoid connecting if systemd-journal-gatewayd is not available * Use path for all options * Add pytests * Address pylint issues * Boot ID offsets and slug to identifier * Fix tests * API refactor from feedback * fix tests and add identifiers * stop isort and pylint fighting * fix tests * Update default log identifiers * Only modify /host/logs endpoints * Fix bad import * Load log caches asynchronously at startup * Allow task to complete in fixture * Boot IDs and identifiers loaded on demand * Add suggested identifiers * Fix tests around boot ids Co-authored-by: Mike Degatano <michael.degatano@gmail.com>
2 lines
1.9 KiB
Plaintext
2 lines
1.9 KiB
Plaintext
{"_GID":"0","_HOSTNAME":"homeassistant","_UID":"0","__CURSOR":"s=fe3fc256ac7f4d7e9f4abbfa9f5457a6;i=3753c53;b=b2aca10d5ca54fb1b6fb35c85a0efca9;m=5cdaab7;t=5e76f13d3ccbd;x=30603973f0648b80","MESSAGE_ID":"b07a249cd024414a82dd00cd181378ff","SYSLOG_IDENTIFIER":"systemd","CODE_FILE":"src/core/manager.c","_CMDLINE":"/sbin/init","TID":"1","_COMM":"systemd","MESSAGE":"Startup finished in 1.907s (kernel) + 1min 35.456s (userspace) = 1min 37.364s.","_TRANSPORT":"journal","_CAP_EFFECTIVE":"1ffffffffff","CODE_FUNC":"manager_notify_finished","_SYSTEMD_UNIT":"init.scope","KERNEL_USEC":"1907954","PRIORITY":"6","_SYSTEMD_CGROUP":"/init.scope","SYSLOG_FACILITY":"3","USERSPACE_USEC":"95456563","_SOURCE_REALTIME_TIMESTAMP":"1661839143586929","_PID":"1","_EXE":"/usr/lib/systemd/systemd","__REALTIME_TIMESTAMP":"1661839143587005","CODE_LINE":"3450","_SYSTEMD_SLICE":"-.slice","_MACHINE_ID":"41669ad30bf148ad842fdc89597b3c04","_BOOT_ID":"b2aca10d5ca54fb1b6fb35c85a0efca9","__MONOTONIC_TIMESTAMP":"97364663"}
|
|
{"_GID":"0","CODE_FILE":"src/core/manager.c","MESSAGE_ID":"b07a249cd024414a82dd00cd181378ff","_SYSTEMD_SLICE":"-.slice","SYSLOG_IDENTIFIER":"systemd","PRIORITY":"6","_SYSTEMD_CGROUP":"/init.scope","TID":"1","_HOSTNAME":"homeassistant","CODE_FUNC":"manager_notify_finished","KERNEL_USEC":"1899908","__MONOTONIC_TIMESTAMP":"97940408","_SOURCE_REALTIME_TIMESTAMP":"1663424928174145","_BOOT_ID":"b1c386a144fd44db8f855d7e907256f8","_TRANSPORT":"journal","__CURSOR":"s=fe3fc256ac7f4d7e9f4abbfa9f5457a6;i=390f660;b=b1c386a144fd44db8f855d7e907256f8;m=5d673b8;t=5e8e04bf4505d;x=e6c39dc6b167e68","SYSLOG_FACILITY":"3","_EXE":"/usr/lib/systemd/systemd","USERSPACE_USEC":"96040432","__REALTIME_TIMESTAMP":"1663424928174173","_MACHINE_ID":"41669ad30bf148ad842fdc89597b3c04","_COMM":"systemd","_SYSTEMD_UNIT":"init.scope","CODE_LINE":"3450","MESSAGE":"Startup finished in 1.899s (kernel) + 1min 36.040s (userspace) = 1min 37.940s.","_PID":"1","_UID":"0","_CAP_EFFECTIVE":"1ffffffffff","_CMDLINE":"/sbin/init"} |