Get log file content
GET
/system/logs/{file}
const url = 'https://example.com/api/v1/system/logs/example?n=10&skip=0';const options = {method: 'GET', headers: {cookie: 'grommunioAuthJwt=<grommunioAuthJwt>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url 'https://example.com/api/v1/system/logs/example?n=10&skip=0' \ --cookie grommunioAuthJwt=<grommunioAuthJwt>Returns the n last lines of the log file, similar to the tail command line tool
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”file
required
string
Name of the log file
Query Parameters
Section titled “Query Parameters”n
integer
Number of lines to return
skip
integer
Number of lines to skip
after
Precise date/time string including fractional seconds
string
Return all lines after given time. Overrides n and skip.
Responses
Section titled “Responses”List of log files returned
Media typeapplication/json
object
data
Array<object>
Log file entry
object
level
Priority level number as described in journalctl (1)
integer
message
Log message
string
time
Precise date/time string including fractional seconds
string
runtime
Time since last reboot
number
Examplegenerated
{ "data": [ { "level": 1, "message": "example", "time": "example", "runtime": 1 } ]}Validation of input parameters failed
Media typeapplication/json
object
message
string
errors
List of errors encountered during validation
Array<string>
Examplegenerated
{ "message": "example", "errors": [ "example" ]}The requested resource could not be found
Media typeapplication/json
object
message
string
Examplegenerated
{ "message": "example"}An error occurred while processing the request
Media typeapplication/json
object
message
String representation of the exception
string
Examplegenerated
{ "message": "example"}