> ## Documentation Index
> Fetch the complete documentation index at: https://ayakaleaf-pro.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# 로깅

`bin/logs` 스크립트를 사용하여 서비스의 로그를 볼 수 있습니다.

기본 사용 예시:

```bash theme={null}
# View the web service logs
bin/logs web

# Show help
bin/logs --help

# View logs for multiple services at once
bin/logs filestore docstore web clsi

# Follow log output (like tail -f)
bin/logs -f filestore docstore web clsi

# Limit the number of lines printed (default 50)
bin/logs -n 50 web

# Show all log lines
bin/logs -n all web

# Redirect output to a file
bin/logs -n all web > web.log
```

`bin/logs` 스크립트로 다음 서비스의 로그를 볼 수 있습니다: `clsi`, `contacts`, `docstore`, `document-updater`, `filestore`, `git-bridge`, `mongo`, `notifications`, `real-time`, `redis`, `spelling`, `tags`, `track-changes`, `web`, `web-api`, `history-v1`, `project-history`.

## 로그 복사

원본 문서를 참고하세요: [https://docs.overleaf.com/on-premises/configuration/overleaf-toolkit/logging#copying-logs](https://docs.overleaf.com/on-premises/configuration/overleaf-toolkit/logging#copying-logs)

메인 `sharelatex` 컨테이너의 로그 파일을 로컬 컴퓨터로 복사합니다:

```bash theme={null}
docker cp sharelatex:/var/log/overleaf/{service-name}.log {service-name}.log
```

## 로그 영구 보존

Docker 컨테이너는 일시적(ephemeral)이므로, 런타임 중 컨테이너 내부에 생성된 파일/디렉터리(로그 파일 포함)는 컨테이너가 다시 생성될 때(예: `bin/up` 실행 시) 삭제됩니다. 컨테이너를 다시 생성해도 로그 파일을 유지하려면:

* Toolkit에서 사용하는 `config/overleaf.rc` 파일에 환경 변수 `OVERLEAF_LOG_PATH`를 설정하세요. 이 값은 `sharelatex` 컨테이너 내부의 로그 디렉터리에 바인드 마운트될 호스트의 디렉터리여야 합니다.
* 이 값을 변경하고 `bin/up -d`를 실행하면 로그 파일이 호스트에 영구 보존되어 직접 접근할 수 있습니다.

<Warning>
  바인드 마운트에 사용하는 호스트 로그 디렉터리의 소유자를 `www-data` 사용자(uid=33)로 설정하고, 권한이 `drwxr-xr-x`(755)인지 확인해야 합니다.

  예:

  ```bash theme={null}
  chown 33:33 data/overleaf/logs
  chmod 755 data/overleaf/logs
  ```
</Warning>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.