> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cloudtype.io/llms.txt
> Use this file to discover all available pages before exploring further.

# 로그뷰

## 로그 조회하기

로그 조회할 컨테이너 ID 를 조회합니다.

```sh theme={null}
$ ctype ins
Current stage is "@demo/myproject:main"
APP      ID                 STATUS      STARTED AT              EXPOSE
node     node:node:0        running     2022-01-11 14:40:06     3000
node     node:gitsync:0     running     2022-01-11 14:40:06     -
```

실행중인 애플리케이션의 실시간 로그를 조회하는 방법입니다. 아래 명령은 현재 프로젝트의 `myapp` 애플리케이션 로그를 조회합니다.

```sh theme={null}
$ ctype logs node node:node:0
node@16 is starting...
no pre-install command
...
```

배포환경 옵션을 사용하면 다른 프로젝트나 배포환경의 애플리케이션의 로그를 조회할 수 있습니다.

```sh theme={null}
$ ctype logs node node:node:0 -t @demo/myproject:dev
```

***

## 로그 옵션

1. `--tailLines` 혹은 `-l`<br />
   tailLines 옵션을 사용하면 마지막 로그로부터 이전의 라인부터 조회할 수 있습니다.
   ```sh theme={null}
   $ ctype logs node node:node:0 -l 10
   ```

2. `--timestamps` 혹은 `-m`<br />
   timestamp 옵션을 사용하면 로그 시간을 함께 볼 수 있습니다.
   ```sh theme={null}
   $ ctype logs node node:node:0 -m
   ```

3. `--target` 혹은 `-t`<br />
   target 옵션으로 현재 배포환경이 아닌 배포환경을 직접 지정할 수 있습니다.
   ```sh theme={null}
   $ ctype logs node node:node:0 -t @demo/projectname:stage
   ```
