Reading Pod Logs

Function

This API is used to query the logs of a specified pod.

URI

GET /api/v1/namespaces/{namespace}/pods/{name}/log

Table 1 Path parameters

Parameter

Description

namespace

Object name and auth scope, such as for teams and projects.

name

Name of the Pod.

Table 2 Query parameters

Parameter

Mandatory

Description

pretty

No

If 'true', then the output is pretty printed.

exact

No

Should the export be exact. Exact export maintains cluster-specific fields like 'Namespace'.

export

No

Should this value be exported. Export strips fields that a user cannot specify.

Request

N/A

Response

Example response

Message "Helloworld" printed by the pod:

Tue Sep  3 03:15:25 UTC 2019
Helloworld
Tue Sep  3 03:15:26 UTC 2019
Helloworld
Tue Sep  3 03:15:27 UTC 2019
Helloworld

Status Code

Table 3 Status code

Status Code

Description

200

This operation succeeds.

For more status codes, see Status Codes.