docker logs

1 개요[ | ]

docker logs
  • 컨테이너의 로그를 보여주는 docker 명령어
docker logs <friendly-name|container-id>

2 예시 1[ | ]

$ docker logs -f a9e
192.168.9.1 - - [14/Jul/2015:01:04:02 +0000] "GET / HTTP/1.1" 200 612 "-" "curl/7.35.0" "-"
192.168.9.1 - - [14/Jul/2015:01:04:03 +0000] "GET / HTTP/1.1" 200 612 "-" "curl/7.35.0" "-"

3 예시 2[ | ]

$ docker run -d redis
71ffc984161466c99a219933792e6547ae158d6132e08b7fd0347dd6a62eeb7b
$ docker ps
CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS      PORTS               NAMES
71ffc9841614        redis               "docker-entrypoint.s…"   13 seconds ago      Up 10 seconds      6379/tcp            distracted_brahmagupta
$ docker logs redis
Error: No such container: redis
$ docker logs 71ffc9841614
1:C 30 Oct 01:12:48.274 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
1:C 30 Oct 01:12:48.275 # Redis version=4.0.11, bits=64, commit=00000000, modified=0, pid=1, just started
1:C 30 Oct 01:12:48.275 # Warning: no config file specified, using the default config. In order tospecify a config file use redis-server /path/to/redis.conf
1:M 30 Oct 01:12:48.349 * Running mode=standalone, port=6379.
1:M 30 Oct 01:12:48.349 # WARNING: The TCP backlog setting of 511 cannot be enforced because /proc/sys/net/core/somaxconn is set to the lower value of 128.
1:M 30 Oct 01:12:48.349 # Server initialized
1:M 30 Oct 01:12:48.350 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
1:M 30 Oct 01:12:48.350 # WARNING you have Transparent Huge Pages (THP) support enabled in your kernel. This will create latency and memory usage issues with Redis. To fix this issue run the command 'echo never > /sys/kernel/mm/transparent_hugepage/enabled' as root, and add it to your /etc/rc.local in order to retain the setting after a reboot. Redis must be restarted after THP is disabled.
1:M 30 Oct 01:12:48.350 * Ready to accept connections

4 같이 보기[ | ]

5 참고[ | ]

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}