123k views
4 votes
What command displays the logs for the specified service in your swarm?

A) docker logs -s service_name

B) docker service logs service_name

C) docker swarm logs service_name

D) docker service catlogs service_name

1 Answer

2 votes

Final answer:

The correct command to display logs for a specific service in a Docker Swarm is 'docker service logs service_name'. This provides the log output from all tasks of the service.

Step-by-step explanation:

The command used to display the logs for a specified service in a Docker Swarm is B) docker service logs service_name. Using this command, you can retrieve the log output from all the tasks of the service.

If you only want to see the logs from a specific task or tasks, you can specify it by appending the task ID to the service name.

User Mbuechmann
by
8.5k points