Add API to get cloudron logs

part of #304
This commit is contained in:
Girish Ramakrishnan
2017-04-18 15:15:35 -07:00
parent 5f888341ea
commit 0c706cffc0
4 changed files with 89 additions and 1 deletions

View File

@@ -827,6 +827,32 @@ Response (200):
}
```
### Get logs
GET `/api/v1/cloudron/logs` <scope>admin</scope>
Get the system logs.
The `lines` query parameter can be used to specify the number of log lines to download.
The `units` query parameters can be set to `box` or `mail` to get logs of specific units.
The response has `Content-Type` set to 'application/x-logs' and `Content-Disposition` set to
`attachment; filename="log.txt`.
Response(200):
```
Line delimited JSON.
{
realtimeTimestamp: <number>, // wallclock timestamp
monotonicTimestamp: <number>, // time passed since boot
message: [ <byte>,... ], // utf8 buffer
source: <process name> // source of this message
}
```
### List events
GET `/api/v1/cloudron/eventlog` <scope>admin</scope>