> 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/it/configurazione/overleaf-toolkit/logging.md).

# Log

Puoi usare lo `bin/logs` script per visualizzare i log dei servizi.

Esempi di utilizzo di base:

```bash
# Visualizza i log del servizio web
bin/logs web

# Mostra l'aiuto
bin/logs --help

# Visualizza i log di più servizi contemporaneamente
bin/logs filestore docstore web clsi

# Segui l'output dei log (come tail -f)
bin/logs -f filestore docstore web clsi

# Limita il numero di righe visualizzate (predefinito 50)
bin/logs -n 50 web

# Mostra tutte le righe di log
bin/logs -n all web

# Reindirizza l'output a un file
bin/logs -n all web > web.log
```

Puoi usare lo `bin/logs` script per visualizzare i log dei seguenti servizi: `clsi`, `contacts`, `docstore`, `document-updater`, `filestore`, `git-bridge`, `mongo`, `notifications`, `real-time`, `redis`, `spelling`, `tags`, `track-changes`, `web`, `web-api`, `history-v1`, `project-history`.

## Copia dei log

Vedi la documentazione originale: <https://docs.overleaf.com/on-premises/configuration/overleaf-toolkit/logging#copying-logs>

Copia i file di log dal principale `sharelatex` contenitore sul tuo computer locale:

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

## Persistenza dei log

I container Docker sono effimeri, il che significa che i file/directory creati all'interno del container durante l'esecuzione (inclusi i file di log) verranno eliminati se il container viene ricreato (ad esempio, quando si esegue `bin/up`). Per conservare i file di log tra una ricreazione e l'altra del container:

* Imposta la variabile d'ambiente `OVERLEAF_LOG_PATH` nel `config/overleaf.rc` file utilizzato dal Toolkit. Questa dovrebbe essere la directory sull'host che verrà montata in bind nella directory dei log all'interno del `sharelatex` contenitore.
* Dopo aver modificato questo e aver eseguito `bin/up -d`i file di log verranno mantenuti sull'host e accessibili direttamente.

{% hint style="warning" %}
Devi impostare il proprietario della directory dei log dell'host usata per il bind-mount su `www-data` utente (uid=33) e assicurarti che i permessi siano `drwxr-xr-x` (755).

Esempio:

```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/it/configurazione/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.
