Timestamps for docker logs.

Fixes #1165
Docker-DCO-1.1-Signed-off-by: Alexandr Morozov <lk4d4math@gmail.com> (github: LK4D4)
This commit is contained in:
Alexandr Morozov
2014-05-01 20:40:36 +04:00
parent 51a39563fa
commit d1297feef8
10 changed files with 386 additions and 38 deletions
@@ -45,6 +45,10 @@ You can still call an old version of the api using
You can now use the `-until` parameter to close connection
after timestamp.
`GET /containers/(id)/logs`
This url is prefered method for getting container logs now.
### v1.10
#### Full Documentation
@@ -300,6 +300,42 @@ List processes running inside the container `id`
- **404** – no such container
- **500** – server error
### Get container logs
`GET /containers/(id)/logs`
Get stdout and stderr logs from the container ``id``
**Example request**:
GET /containers/4fa6e0f0c678/logs?stderr=1&stdout=1&timestamps=1&follow=1 HTTP/1.1
**Example response**:
HTTP/1.1 200 OK
Content-Type: application/vnd.docker.raw-stream
{{ STREAM }}
Query Parameters:
 
- **follow** – 1/True/true or 0/False/false, return stream.
Default false
- **stdout** – 1/True/true or 0/False/false, if logs=true, return
stdout log. Default false
- **stderr** – 1/True/true or 0/False/false, if logs=true, return
stderr log. Default false
- **timestamps** – 1/True/true or 0/False/false, if logs=true, print
timestamps for every log line. Default false
Status Codes:
- **200** – no error
- **404** – no such container
- **500** – server error
### Inspect changes on a container's filesystem
`GET /containers/(id)/changes`
+4 -3
View File
@@ -649,13 +649,14 @@ Fetch the logs of a container
Usage: docker logs [OPTIONS] CONTAINER
-f, --follow=false: Follow log output
-t, --timestamps=false: Show timestamps
The `docker logs` command batch-retrieves all logs
present at the time of execution.
The `docker logs --follow` command combines `docker logs` and `docker
attach`: it will first return all logs from the beginning and then
continue streaming new output from the container'sstdout and stderr.
The ``docker logs --follow`` command will first return all logs from the
beginning and then continue streaming new output from the container's stdout
and stderr.
## port