简体   繁体   中英

`docker logs` vs `docker container logs`

There seems to be two commands to fetch logs from a container

docker logs <container_name>

eg

tapan@y500:~$ docker logs es OpenJDK 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release. [2018-11-02T16:35:26,485][INFO ][oenNode] [] initializing...

or

docker conainer logs <container_name>

tapan@y500:~$ docker container logs es OpenJDK 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release. [2018-11-02T16:35:26,485][INFO ][oenNode ] [] initializing ...

What is the difference between them if any?

Please see this pull request https://github.com/moby/moby/pull/26025

Docker CLI evolved and they kept old commands.

So basically docker container logs refers to the same code than docker logs .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM