> For the complete documentation index, see [llms.txt](https://overleaf-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://overleaf-pro.ayaka.space/on-premises/ar/aliadadat/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" %}
يجب أن تضبط مالك دليل سجلات المضيف المستخدم لعملية الربط إلى المستخدم `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://overleaf-pro.ayaka.space/on-premises/ar/aliadadat/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.
