-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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 are not returned in chronological order #4976
Comments
Thanks for reporting I'm not sure if this is possible to fix, or at least this would require careful consideration; when running swarm services, those services are distributed in the cluster, and may be running on different nodes. In addition, the logs printed can originate from STDOUT and STDERR, one of which is buffered, the other is not; for the latter one there's a (still open) ticket; moby/moby#31706 The For debugging purposes, you could consider using docker service logs --timestamps myservice 2>&1 | sort For collecting logs of your swarm cluster, using a log-aggregator can also be a good option; in that case logs from the cluster can be collected centrally (https://docs.docker.com/config/containers/logging/configure/) |
Description
docker service logs <service>
does not return results in chronological order.Reproduce
docker service logs --timestamps <service>
.Example output:
Expected behavior
The expected results from the command is to see log results in chronological order as determined by their timestamps.
docker version
Client: Docker Engine - Community Version: 26.0.0 API version: 1.45 Go version: go1.21.8 Git commit: 2ae903e Built: Wed Mar 20 15:17:48 2024 OS/Arch: linux/amd64 Context: default Server: Docker Engine - Community Engine: Version: 26.0.0 API version: 1.45 (minimum version 1.24) Go version: go1.21.8 Git commit: 8b79278 Built: Wed Mar 20 15:17:48 2024 OS/Arch: linux/amd64 Experimental: false containerd: Version: 1.6.28 GitCommit: ae07eda36dd25f8a1b98dfbf587313b99c0190bb runc: Version: 1.1.12 GitCommit: v1.1.12-0-g51d5e94 docker-init: Version: 0.19.0 GitCommit: de40ad0
docker info
Additional Info
No response
The text was updated successfully, but these errors were encountered: