Read and download the system and application logs
The device keeps two log files: the system log (operating system and services) and the application log (IOTA services). Both can be read partially through the API or downloaded completely. Downloads are meant for a browser: the client first obtains a one-time download token with its session, then fetches the file with that token in the URL and without an authorization header.
/api/syslog/log/sysGETadminlines - optional, number of lines from the end of the log to return. Without it the last 300 MiB of the file are returned.text/plain, with the header Content-Disposition: attachment; filename="syslog_<epoch>.txt"lines is negative or not a number/api/syslog/log/appGETadminlines, as abovetext/plain, with the header Content-Disposition: attachment; filename="applog_<epoch>.txt"lines is negative or not a number/api/syslog/tokenGETadminPath: /api/syslog/system/download
Method: GET
Minimum user role: none (no authorization header); the download token in the URL is checked instead
URL parameters:
token - a download token from /api/syslog/token (mandatory)Response on success (200 OK): the whole log file as text/plain, with the header Content-Disposition: attachment; filename="syslog_<epoch>.txt"
Response on failure (403 Forbidden): the token parameter is missing, unknown or already used
Example:
TOKEN_DL=$(curl -sk -H "authorization: <token>" https://<ip-address>/api/syslog/token)
curl -sk -o syslog.txt "https://<ip-address>/api/syslog/system/download?token=$TOKEN_DL"/api/syslog/application/downloadGETauthorization header); the download token in the URL is checked insteadtoken, as abovetext/plain, with the header Content-Disposition: attachment; filename="applog_<epoch>.txt"token parameter is missing, unknown or already used