> 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/pt/configuracao/overleaf-toolkit/logging.md).

# Registo

Você pode usar o `bin/logs` script para ver os logs dos serviços.

Exemplos básicos de uso:

```bash
# Ver os logs do serviço web
bin/logs web

# Mostrar ajuda
bin/logs --help

# Ver logs de vários serviços ao mesmo tempo
bin/logs filestore docstore web clsi

# Acompanhar a saída do log (como tail -f)
bin/logs -f filestore docstore web clsi

# Limitar o número de linhas impressas (padrão 50)
bin/logs -n 50 web

# Mostrar todas as linhas do log
bin/logs -n all web

# Redirecionar a saída para um arquivo
bin/logs -n all web > web.log
```

Você pode usar o `bin/logs` script para ver os logs dos seguintes serviços: `clsi`, `contacts`, `docstore`, `document-updater`, `filestore`, `git-bridge`, `mongo`, `notifications`, `real-time`, `redis`, `spelling`, `tags`, `track-changes`, `web`, `web-api`, `history-v1`, `project-history`.

## Copiando logs

Veja a documentação original: <https://docs.overleaf.com/on-premises/configuration/overleaf-toolkit/logging#copying-logs>

Copie os ficheiros de log do principal `sharelatex` contentor para o seu computador local:

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

## Persistindo logs

Os contentores Docker são efémeros, o que significa que os ficheiros/diretórios criados dentro do contentor durante o tempo de execução (incluindo ficheiros de log) serão descartados se o contentor for recriado (por exemplo, ao executar `bin/up`). Para manter os ficheiros de log entre recriações do contentor:

* Defina a variável de ambiente `OVERLEAF_LOG_PATH` no `config/overleaf.rc` ficheiro usado pelo Toolkit. Este deve ser o diretório no host que será montado com bind no diretório de logs dentro do `sharelatex` contentor.
* Depois de alterar isto e executar `bin/up -d`, os ficheiros de log serão persistidos no host e acessíveis diretamente.

{% hint style="warning" %}
Você deve definir o proprietário do diretório de logs do host usado para o bind-mount como o `www-data` utilizador (uid=33) e garantir que as permissões sejam `drwxr-xr-x` (755).

Exemplo:

```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/pt/configuracao/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.
