As of supervisor version
/api/host/logs endpoint allows clients to interface directly with the system journal via supervisor. You can make calls to this endpoint from the cli by doing
ha host logs. It doesn’t have all the options of journalctl but it has enough to cover this use case. To see logs for a particular addon you can do this:
ha host logs --identifier addon_core_mosquitto
core_mosquitto with the slug of the addon you want to see logs for. The only kind of gotcha is that you have to prefix the addon slug with
addon_ since it has to be the docker container name.
You can also limit the results to a specific number of rows, specific boot of the machine and tail with the other options:
> ha host logs -h
Allows you to look at the systemd journal on the host to see logs
across services and boots.
ha host logs [flags]
ha host logs [command]
logs, log, lg
ha host logs
boots Show all boot IDs by offset
identifiers Show all syslog identifiers
-b, --boot string Logs of particular boot ID
-f, --follow Continuously print new log entries
-h, --help help for logs
-t, --identifier string Show entries with the specified syslog identifier
-n, --lines int32 Number of log entries to show
This can all be done from the ssh or vscode addons without going directly to the host shell.