> 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/ru/konfiguraciya/overleaf-toolkit/logging.md).

# Журналирование

Вы можете использовать `bin/logs` скрипт для просмотра журналов служб.

Примеры базового использования:

```bash
# Просмотреть журналы веб-сервиса
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/ru/konfiguraciya/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.
