Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |
Tags
- spring mapper
- JPA DB Connection 다중
- spring @mapper
- Vue
- JPA DB 다중 Connection
- CrudRepository update
- vuecomponent
- 자바버그수정
- Data Annotation
- NoArgsConstructor
- Transactions Propagation Option
- spring mapper annotation
- AllArgsConstructor
- spring JPA DB multi Connection
- 도커 로그 확인
- docker 로그
- spring repository
- JpaRepository update
- @Builder @NoArgsConstructor
- mapper annotationo
- vueslot
- doker logs tail
- repository annotation
- Spring JPA Specification
- spring DB Connection
- Spring
- 도커 컨테이너 로그
- JAVA Exception 종류
- spring JPA DB Connection
- 도커 logs
Archives
- Today
- Total
개발을 잘하고 싶은 개발자
[Docker] 도커 컨테이너의 로그가 궁금해 docker logs 본문
리눅스 서버에서 log 파일을 vi, tail, cat 등등 명령어로 볼 줄은 알았지만
도커에 따로 docker logs가 있는 줄 몰랐다!!
나도 이제 도커 로그를 맘대로 다룰 줄 알게 되었어~
document https://docs.docker.com/engine/reference/commandline/logs/
docker logs
docker logs: The `docker logs` command batch-retrieves logs present at the time of execution. > **Note** > > This command is only functional for containers that are started with the...
docs.docker.com
사용법
$ docker logs [OPTIONS] CONTAINER
옵션
이름, 약칭 | 기본 | 설명 |
--details | 로그에 제공된 추가 세부정보 표시 | |
--follow , -f | 로그 출력 팔로우 | |
--since | 타임스탬프(예: 2013-01-02T13:23:37Z) 또는 상대적(예: 42분 동안 42m) 이후의 로그 표시 | |
--tail , -n | all | 로그 끝에서 표시할 줄 수 |
--timestamps , -t | 타임스탬프 표시 | |
--until | 타임스탬프(예: 2013-01-02T13:23:37Z) 또는 상대적(예: 42분 동안 42m) 이전에 로그 표시 |
이 중 많이 사용할 만한 명령어로 예시를 들어보면
마지막에 찍히는 10개의 로그만 보고 싶을 때
$ docker logs --tail 10 my_docker
지금부터 생성되는 로그가 보고 싶어
$ docker logs -f my_docker
또는 응용해서 특정 메세지가 들어간 로그만 보고 싶을 때는
$ docker logs my_docker | grep 2021/08/04
도커에 문제가 생기면 이제 로그를 한눈에 찾아 문제를 해결할 수 있어요!
오늘도 레벨업 Level UP
