> For the complete documentation index, see [llms.txt](https://ayakaleaf-pro.ayaka.space/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://ayakaleaf-pro.ayaka.space/on-premises/ja/she-ding/overleaf-toolkit/logging.md).

# ログ

次のものを使用できます: `bin/logs` サービスのログを表示するためのスクリプトです。

基本的な使用例:

```bash
# web サービスのログを表示
bin/logs web

# ヘルプを表示
bin/logs --help

# 複数のサービスのログを一度に表示
bin/logs filestore docstore web clsi

# ログ出力を追跡する（tail -f のように）
bin/logs -f filestore docstore web clsi

# 出力する行数を制限する（デフォルトは 50 行）
bin/logs -n 50 web

# すべてのログ行を表示
bin/logs -n all web

# 出力をファイルにリダイレクト
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>

メインの `sharelatex` コンテナからローカルコンピュータへログファイルをコピーします:

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

## ログを永続化する

Docker コンテナは一時的なものであり、実行中にコンテナ内で作成されたファイル/ディレクトリ（ログファイルを含む）は、コンテナが再作成されると破棄されます（たとえば、次を実行したとき `bin/up`）。コンテナの再作成間でもログファイルを保持するには:

* 環境変数を設定します `OVERLEAF_LOG_PATH` の `config/overleaf.rc` Toolkit で使用するファイル内に。これは、ホスト上でログディレクトリとして bind mount されるディレクトリである必要があります。 `sharelatex` コンテナ。
* これを変更して次を実行すると `bin/up -d`、ログファイルはホスト上に保持され、直接アクセスできるようになります。

{% hint style="warning" %}
bind mount に使用するホスト側のログディレクトリの所有者を `www-data` ユーザー（uid=33）に設定し、権限が次のようになっていることを確認してください `drwxr-xr-x` (755).

例:

```bash
chown 33:33 data/overleaf/logs
chmod 755 data/overleaf/logs
```

{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://ayakaleaf-pro.ayaka.space/on-premises/ja/she-ding/overleaf-toolkit/logging.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
