mirror of
https://github.com/balena-os/balena-supervisor.git
synced 2025-02-21 18:06:47 +00:00
Add usage example repo to documentation
Change-type: patch Signed-off-by: Cameron Diver <cameron@balena.io>
This commit is contained in:
parent
48bccd34db
commit
da0534b3c8
12
docs/API.md
12
docs/API.md
@ -1204,18 +1204,18 @@ Show journal logs from `unit` only, equivalent to
|
||||
`journalctl --unit=<unit>`.
|
||||
|
||||
##### format
|
||||
Added in supervisor version v10.3.0
|
||||
|
||||
The format which will be streamed from journalctl, formats
|
||||
are described here:
|
||||
https://www.freedesktop.org/software/systemd/man/journalctl.html#-o
|
||||
|
||||
Fields should be provided via POST body in JSON format.
|
||||
|
||||
From an application container (with systemd installed):
|
||||
From an application container:
|
||||
```
|
||||
$ curl -X POST -H "Content-Type: application/json" --data '{"follow":true,"all":true}' "$BALENA_SUPERVISOR_ADDRESS/v2/journal-logs?apikey=$BALENA_SUPERVISOR_API_KEY" | systemd-journal-remote - -o log.journal
|
||||
$ curl -X POST -H "Content-Type: application/json" --data '{"follow":true,"all":true}' "$BALENA_SUPERVISOR_ADDRESS/v2/journal-logs?apikey=$BALENA_SUPERVISOR_API_KEY" > log.journal
|
||||
```
|
||||
|
||||
The `log.journal` file can then be viewed with
|
||||
```
|
||||
journalctl --file log.journal -f
|
||||
```
|
||||
An example project using this endpoint can be found
|
||||
[in this repository](https://github.com/balena-io-playground/device-cloud-logging).
|
Loading…
x
Reference in New Issue
Block a user