์ต๊ทผ AWS EC2 ๋ฅผ ์ฌ์ด๋ ํ๋ก์ ํธ์ ์ฌ์ฉํ๊ฒ ๋๋ฉด์, ๋ก๊ทธ๋ฅผ ํ์ธํ ์ผ์ด ์๊ฒผ๋ค.
๊ทธ๋ฐ๋ฐ ํฐ๋ฏธ๋์์ ssh ๋ก EC2 ์ ์ ์ํ๋ค๋ณด๋, ๋ก๊ทธ๋ฅผ tui ๋ก ๋ด์ผํ๋๊ฒ ์๋๊ฐ?
๊ธฐ์กด์ ๋ก๊ทธ๋ฅผ ํ์
ํ๋ tail -f
์ฒ๋ผ docker cli ์๋ ๋น์ทํ๊ฒ ์๋์ง ์ฐพ์๋ดค๊ณ , ์กด์ฌํ๋ค.
[ec2-user@server ~]$ docker logs -f --tail 10 {{container-name}}
This generated password is for development use only. Your security configuration must be updated before running your application in production.
2023-09-10T03:22:14.481+09:00 INFO 1 --- [ main] o.s.b.a.e.web.EndpointLinksResolver : Exposing 1 endpoint(s) beneath base path '/actuator'
2023-09-10T03:22:14.601+09:00 INFO 1 --- [ main] o.s.s.web.DefaultSecurityFilterChain : Will secure any request with [~~~]
2023-09-10T03:22:16.289+09:00 INFO 1 --- [ main] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 8080 (http) with context path ''
2023-09-10T03:22:16.340+09:00 INFO 1 --- [ main] m.z.ServerApplicationKt : Started ServerApplicationKt in 14.852 seconds (process running for 16.395)
2023-09-10T03:22:25.913+09:00 INFO 1 --- [nio-8080-exec-1] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring DispatcherServlet 'dispatcherServlet'
2023-09-10T03:22:25.917+09:00 INFO 1 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet : Initializing Servlet 'dispatcherServlet'
2023-09-10T03:22:25.928+09:00 INFO 1 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet : Completed initialization in 9 ms
2023-09-10T03:23:50.857+09:00 INFO 1 --- [nio-8080-exec-6] o.springdoc.api.AbstractOpenApiResource : Init duration for springdoc-openapi is: 2049 ms
๋ค๋ฅธ ์ต์ ์ ์๋์ ๊ฐ๋ค.
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) |