-
Notifications
You must be signed in to change notification settings - Fork 18.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Docker Service Logs --tail and --since Not Working as Expected #32331
Comments
The |
Cools, thanks. Perhaps the v27 API docs should reflect that? |
Hm, yes, we may have to find a way to distinguish "experimental" (i.e., still able to change) from "stable" endpoints as well. Perhaps you're interested in opening a pull request against the 17.03.x branch; https://github.com/docker/docker/blob/17.03.x/api/swagger.yaml for the tail/since options |
Facing the same problem on this version: Client: Server: |
Facing the same issue on 18.09. |
the "since" functionality in the SDK is still broken 2 years later |
19.03.3 and still isn't working with specific timestamps |
Just chiming in five and a half years later, and it's still not working. Does anyone at Docker even actually still work on Swarm Mode, or has it silently been abandoned..? |
returns 20 records to count it, one can:
|
Curious (I'm not deeply familiar with the implementation in swarm); in your case could it be that there's 2 instances of the service? (i.e., could it be using 10 records per task ?) |
@thaJeztah good catch. I did not expect that. Another service, where I have just single replica, provides expected number of records. It is a bit surprising, but I can understand the reasons. Fetching logs from multiple services, sorting them and finally limiting output only to defined number is too much hassle and would make the code much more complex. |
BUG REPORT INFORMATION
Description
Using the
--since
and--tail
flags with the command line tool, or thesince
ortail
parameters via the API, does not yield expected results.Steps to reproduce the issue:
The following is true for either the cli or the API, but I'll describe it for the cli to keep things simple:
docker service logs --tail 1 [SERVICE]
ordocker service logs [1491249483 || 1m10s etc.] [SERVICE]
Describe the results you received:
Many lines returned, and in the case of failing services which are retrying every n seconds, this is thousands of lines.
Describe the results you expected:
With
--tail 1
, only 1 line returned. With--since [TIMESTAMP]
only lines returned since that timestamp.Additional information you deem important (e.g. issue happens only occasionally):
It seems that the extra lines are the result of grabbing logs from all service tasks, though I could be wrong.
Querying the individual containers created by the
docker service
command, the--tail
and--since
options work as expected.Output of
docker version
:Output is from my Mac, but the same thing happens for the same version on Linux:
Output of
docker info
:Again this is from my Mac, but the tests were also performed on Linux with a proper swarm, with the same results:
The text was updated successfully, but these errors were encountered: