github.com/flavio/docker@v0.1.3-0.20170117145210-f63d1a6eec47/docs/reference/commandline/service_logs.md (about) 1 --- 2 title: "service logs (experimental)" 3 description: "The service logs command description and usage" 4 keywords: "service, logs" 5 advisory: "experimental" 6 --- 7 8 <!-- This file is maintained within the docker/docker Github 9 repository at https://github.com/docker/docker/. Make all 10 pull requests against that repo. If you see this file in 11 another repository, consider it read-only there, as it will 12 periodically be overwritten by the definitive file. Pull 13 requests which include edits to this file in other repositories 14 will be rejected. 15 --> 16 17 # service logs 18 19 ```Markdown 20 Usage: docker service logs [OPTIONS] SERVICE 21 22 Fetch the logs of a service 23 24 Options: 25 --details Show extra details provided to logs 26 -f, --follow Follow log output 27 --help Print usage 28 --since string Show logs since timestamp 29 --tail string Number of lines to show from the end of the logs (default "all") 30 -t, --timestamps Show timestamps 31 ``` 32 33 The `docker service logs` command batch-retrieves logs present at the time of execution. 34 35 > **Note**: this command is only functional for services that are started with 36 > the `json-file` or `journald` logging driver. 37 38 For more information about selecting and configuring logging drivers, refer to 39 [Configure logging drivers](https://docs.docker.com/engine/admin/logging/overview/). 40 41 The `docker service logs --follow` command will continue streaming the new output from 42 the service's `STDOUT` and `STDERR`. 43 44 Passing a negative number or a non-integer to `--tail` is invalid and the 45 value is set to `all` in that case. 46 47 The `docker service logs --timestamps` command will add an [RFC3339Nano timestamp](https://golang.org/pkg/time/#pkg-constants) 48 , for example `2014-09-16T06:17:46.000000000Z`, to each 49 log entry. To ensure that the timestamps are aligned the 50 nano-second part of the timestamp will be padded with zero when necessary. 51 52 The `docker service logs --details` command will add on extra attributes, such as 53 environment variables and labels, provided to `--log-opt` when creating the 54 service. 55 56 The `--since` option shows only the service logs generated after 57 a given date. You can specify the date as an RFC 3339 date, a UNIX 58 timestamp, or a Go duration string (e.g. `1m30s`, `3h`). Besides RFC3339 date 59 format you may also use RFC3339Nano, `2006-01-02T15:04:05`, 60 `2006-01-02T15:04:05.999999999`, `2006-01-02Z07:00`, and `2006-01-02`. The local 61 timezone on the client will be used if you do not provide either a `Z` or a 62 `+-00:00` timezone offset at the end of the timestamp. When providing Unix 63 timestamps enter seconds[.nanoseconds], where seconds is the number of seconds 64 that have elapsed since January 1, 1970 (midnight UTC/GMT), not counting leap 65 seconds (aka Unix epoch or Unix time), and the optional .nanoseconds field is a 66 fraction of a second no more than nine digits long. You can combine the 67 `--since` option with either or both of the `--follow` or `--tail` options. 68 69 ## Related information 70 71 * [service create](service_create.md) 72 * [service inspect](service_inspect.md) 73 * [service ls](service_ls.md) 74 * [service rm](service_rm.md) 75 * [service scale](service_scale.md) 76 * [service ps](service_ps.md) 77 * [service update](service_update.md)