edited screen snap breaking out topics for Docker Cloud swarm mode added another where-to-next link added more where-to-next links added back in on-page TOC for create swarm topic incorporated Ryan's review comments on first draft more Ryan's review comments, sweep thru all for consistency, notoc on short pages, etc. removed duplicate link to 'create a new swarm in docker cloud' Laura's comments incorporated re-organized Cloud topics, added in Swarm Mode Ryan's review comments on Cloud, added new type of advisory for Beta previews more review comments, manage infrastructure --> standard mode fixing image testing cloud images updates to Cloud welcome page for Swarm, non-Swarm descriptions add new cloud repository image retake of corrupted image fixed the other instance of corrupted image by referencing the retake fixing corrupted image on GitHub Signed-off-by: Victoria Bialas <victoria.bialas@docker.com>
2.1 KiB
description, keywords, redirect_from, title, notoc
| description | keywords | redirect_from | title | notoc | ||
|---|---|---|---|---|---|---|
| View service logs | View, logs, Python |
|
View service logs | true |
Docker Cloud grants you access to the logs your application writes to stdout.
An internal service multiplexes all the logs from all the containers of a
service into a single stream. To see a service's logs run the docker-cloud service logs command with the name of the service.
If we run docker-cloud service logs web, you'll see logs for both web-1 and
web-2, like the example below.
$ docker-cloud service logs web
[web-1] 2015-01-13T22:45:37.250431077Z * Running on http://0.0.0.0:80/
[web-1] 2015-01-07T17:20:19.076174813Z 83.50.33.64 - - [07/Jan/2015 17:20:19] "GET / HTTP/1.1" 200 -
[web-1] 2015-01-07T17:20:34.209098162Z 83.50.33.64 - - [07/Jan/2015 17:20:34] "GET / HTTP/1.1" 200 -
[web-1] 2015-01-07T18:46:07.116759956Z 83.50.33.64 - - [07/Jan/2015 18:46:07] "GET / HTTP/1.1" 200 -
[web-2] 2015-01-07T18:48:24.550419508Z * Running on http://0.0.0.0:5000/
[web-2] 2015-01-07T18:48:37.116759956Z 83.50.33.64 - - [07/Jan/2015 18:48:37] "GET / HTTP/1.1" 200 -
To see a specific container's logs, use the container logs and the
specific container's name. To learn more about service and container
hostnames, see Service Discovery.
$ docker-cloud container logs web-1
2015-01-07T17:18:24.550419508Z * Running on http://0.0.0.0:80/
2015-01-07T17:20:19.076174813Z 83.50.33.64 - - [07/Jan/2015 17:20:19] "GET / HTTP/1.1" 200 -
2015-01-07T17:20:34.209098162Z 83.50.33.64 - - [07/Jan/2015 17:20:34] "GET / HTTP/1.1" 200 -
2015-01-07T18:46:07.116759956Z 83.50.33.64 - - [07/Jan/2015 18:46:07] "GET / HTTP/1.1" 200 -
Visit your application using curl or your browser again. Run the service logs web command again, and you will see another log message for your visit.
What's Next?
Now, let's explore how to Load balance the service.