[Docker ๐ณ] Container ๋ก๊ทธ ๊ฐ์ ธ์ค๊ธฐ
|AI Summary
- AWS EC2์์ Docker ์ปจํ
์ด๋ ๋ก๊ทธ๋ฅผ ํ์ธํ ๋
docker logs๋ช ๋ น์ด๋ฅผ ์ฌ์ฉํ๋ฉด ๋๋ค. docker logs -f --tail 10 {{container-name}}๋ช ๋ น์ด๋ก ์ต๊ทผ 10์ค ๋ก๊ทธ๋ฅผ ์ค์๊ฐ์ผ๋ก ํ์ธํ ์ ์๋ค.- ์ฃผ์ ์ต์
์ผ๋ก๋
--follow(-f),--tail(-n),--since,--timestamps(-t),--details๋ฑ์ด ์๋ค. --follow์ต์ ์ ๋ก๊ทธ๋ฅผ ์ค์๊ฐ์ผ๋ก ๊ณ์ ์ถ๋ ฅํ๋ฉฐ,--tail์ ์ถ๋ ฅํ ๋ง์ง๋ง ์ค ์๋ฅผ ์ง์ ํ๋ค.--since์--until์ต์ ์ผ๋ก ํน์ ์๊ฐ ๋ฒ์ ๋ด ๋ก๊ทธ๋ฅผ ์กฐํํ ์ ์๋ค.- ์์ธํ ์ต์ ๊ณผ ์ฌ์ฉ๋ฒ์ Docker ๊ณต์ ๋ฌธ์์์ ํ์ธํ ์ ์๋ค.
์ต๊ทผ AWS EC2 ๋ฅผ ์ฌ์ด๋ ํ๋ก์ ํธ์ ์ฌ์ฉํ๊ฒ ๋๋ฉด์, ๋ก๊ทธ๋ฅผ ํ์ธํ ์ผ์ด ์๊ฒผ๋ค.
๊ทธ๋ฐ๋ฐ ํฐ๋ฏธ๋์์ ssh ๋ก EC2 ์ ์ ์ํ๋ค๋ณด๋, ๋ก๊ทธ๋ฅผ tui ๋ก ๋ด์ผํ๋๊ฒ ์๋๊ฐ?
๊ธฐ์กด์ ๋ก๊ทธ๋ฅผ ํ์
ํ๋ tail -f ์ฒ๋ผ docker cli ์๋ ๋น์ทํ๊ฒ ์๋์ง ์ฐพ์๋ดค๊ณ , ์กด์ฌํ๋ค.
| |
๋ค๋ฅธ ์ต์ ์ ์๋์ ๊ฐ๋ค.
| Option | Short | Default | Description |
|---|---|---|---|
| --details | false | Show extra details provided to logs | |
| --follow | -f | false | Follow log output |
| --since | Show logs since timestamp (e.g. 2013-01-02T13:23:37Z) or relative (e.g. 42m for 42 minutes) | ||
| --tail | -n | all | Number of lines to show from the end of the logs |
| --timestamps | -t | false | Show timestamps |
| --until | API 1.35+ Show logs before a timestamp (e.g. 2013-01-02T13:23:37Z) or relative (e.g. 42m for 42 minutes) |