Get the logs of a container
get
/api/v2/containers/{container_id}/logs
Retrieves the logs of a container. You identify the container using the container_id parameter in the API request.
Request
Path Parameters
-
container_id: string
container_id
Security
-
Authorization: apiKey
Type:
apiKey
Response
Supported Media Types
- application/json
200 Response
200 Response
Default Response
Error Payload
Examples
The following example shows how to get the log information for a specific container. You perform this task by submitting a GET request to the REST resource using cURL. For more information about cURL, see Use cURL.
Note: The command in this example uses the URL structure https://rest_server_url/resource-path
, where rest_server_url
is the manager node for the Oracle Cloud Container instance. See Send Requests for the appropriate URL structure to use for Oracle Public Cloud.
cURL Command
curl -sk
-X "GET"
-H "Authorization: Bearer b39f09c71c297f1d"
"https://rest_server_url/api/v2/containers/e60b0b93b8ac4578c10a256cf058532a3bcc1144b438f41e86e8a15afc11e81d/logs"
Example of Response Body
{
"container": {
"container_id": "e60b0b93b8ac4578c10a256cf058532a3bcc1144b438f41e86e8a15afc11e81d",
"stdout": "2016-10-27T04:27:58.979579041Z 1:M 27 Oct 04:27:58.978 # You requested maxclients of 10000 requiring at least 10032 max file descriptors.\n2016-10-27T04:27:58.979630755Z 1:M 27 Oct 04:27:58.978 # Server can't set maximum open files to 10032 because of OS error: Operation not permitted.\n2016-10-27T04:27:58.979641562Z 1:M 27 Oct 04:27:58.978 # Current maximum open files is 4096. maxclients has been reduced to 4064 to compensate for low ulimit. If you need higher maxclients increase 'ulimit -n'.\n2016-10-27T04:27:58.980901891Z _._ \n2016-10-27T04:27:58.980920284Z _.-``__ ''-._ \n2016-10-27T04:27:58.980927697Z _.-`` `. `_. ''-._ Redis 3.2.1 (00000000/0) 64 bit\n2016-10-27T04:27:58.980934683Z .-`` .-```. ```\\/ _.,_ ''-._ \n2016-10-27T04:27:58.980941919Z ( ' , .-` | `, ) Running in standalone mode\n2016-10-27T04:27:58.980949048Z |`-._`-...-` __...-.``-._|'` _.-'| Port: 6379\n2016-10-27T04:27:58.980958255Z | `-._ `._ / _.-' | PID: 1\n2016-10-27T04:27:58.980964892Z `-._ `-._ `-./ _.-' _.-' \n2016-10-27T04:27:58.980971540Z |`-._`-._ `-.__.-' _.-'_.-'| \n2016-10-27T04:27:58.980978493Z | `-._`-._ _.-'_.-' | http://redis.io \n2016-10-27T04:27:58.980985117Z `-._ `-._`-.__.-'_.-' _.-' \n2016-10-27T04:27:58.980991671Z |`-._`-._ `-.__.-' _.-'_.-'| \n2016-10-27T04:27:58.980998263Z | `-._`-._ _.-'_.-' | \n2016-10-27T04:27:58.981004710Z `-._ `-._`-.__.-'_.-' _.-' \n2016-10-27T04:27:58.981011187Z `-._ `-.__.-' _.-' \n2016-10-27T04:27:58.981017722Z `-._ _.-' \n2016-10-27T04:27:58.981024286Z `-.__.-' \n2016-10-27T04:27:58.981032701Z \n2016-10-27T04:27:58.981078162Z 1:M 27 Oct 04:27:58.980 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.\n2016-10-27T04:27:58.981087890Z 1:M 27 Oct 04:27:58.980 # Server started, Redis version 3.2.1\n2016-10-27T04:27:58.981097535Z 1:M 27 Oct 04:27:58.980 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.\n2016-10-27T04:27:58.981106237Z 1:M 27 Oct 04:27:58.980 # WARNING you have Transparent Huge Pages (THP) support enabled in your kernel. This will create latency and memory usage issues with Redis. To fix this issue run the command 'echo never > /sys/kernel/mm/transparent_hugepage/enabled' as root, and add it to your /etc/rc.local in order to retain the setting after a reboot. Redis must be restarted after THP is disabled.\n2016-10-27T04:27:58.981124728Z 1:M 27 Oct 04:27:58.980 * The server is now ready to accept connections on port 6379\n",
"stderr": ""
}
}