docker logs

Shows what a container main process wrote to standard output and standard error.

In more detail

It works on running and stopped containers, which makes it the first thing to read when something fails. -f follows new lines, --since and --tail limit the output. Applications in containers should log to standard output rather than to files, so docker logs and log drivers can collect them.

Example

docker logs --tail 50 -f taskapi-demo

Related terms

Taught in

References

Certification courses