Get service logs Run in API Explorer
Get stdout
and stderr
logs from a service. See also
/containers/{id}/logs
.
Note: This endpoint works only for services with the local
,
json-file
or journald
logging drivers.
Query parameters
-
Show service context and extra details provided to logs.
Default value is
false
. -
Keep connection after returning logs.
Default value is
false
. -
Return logs from
stdout
Default value is
false
. -
Return logs from
stderr
Default value is
false
. -
Only return logs since this time, as a UNIX timestamp
Default value is
0
. -
Add timestamps to every log line
Default value is
false
. -
Only return this number of log lines from the end of the logs. Specify as an integer or
all
to output all log lines.Default value is
all
.
GET
/services/{id}/logs
curl \
--request GET 'http://api.example.com/v1.49/services/{id}/logs'
Response examples (404)
{
"message": "No such service: c2ada9df5af8"
}
Response examples (500)
{
"message": "Something went wrong."
}
Response examples (503)
{
"message": "Something went wrong."
}