> 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/on-premises-no/konfigurasjon/overleaf-toolkit/logging.md).

# Logging

Du kan bruke `bin/logs` skriptet for å vise logger for tjenestene.

Grunnleggende brukseksempler:

```bash
# Vis loggene for webtjenesten
bin/logs web

# Vis hjelp
bin/logs --help

# Vis logger for flere tjenester samtidig
bin/logs filestore docstore web clsi

# Følg loggutdata (som tail -f)
bin/logs -f filestore docstore web clsi

# Begrens antallet linjer som skrives ut (standard 50)
bin/logs -n 50 web

# Vis alle logglinjer
bin/logs -n all web

# Omdiriger utdata til en fil
bin/logs -n all web > web.log
```

Du kan bruke `bin/logs` skriptet for å vise logger for følgende tjenester: `clsi`, `contacts`, `docstore`, `document-updater`, `filestore`, `git-bridge`, `mongo`, `notifications`, `real-time`, `redis`, `spelling`, `tags`, `track-changes`, `web`, `web-api`, `history-v1`, `project-history`.

## Kopiering av logger

Se den originale dokumentasjonen: <https://docs.overleaf.com/on-premises/configuration/overleaf-toolkit/logging#copying-logs>

Kopier loggfiler fra hoved `sharelatex` containeren til den lokale datamaskinen din:

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

## Bevaring av logger

Docker-containere er flyktige, noe som betyr at filer/kataloger som opprettes inne i containeren under kjøring (inkludert loggfiler) vil bli forkastet hvis containeren opprettes på nytt (for eksempel når du kjører `bin/up`). For å bevare loggfiler mellom container-gjenskapelser:

* Sett miljøvariabelen `OVERLEAF_LOG_PATH` i `config/overleaf.rc` filen som brukes av Toolkit. Dette bør være katalogen på verten som skal bind-mountes til loggkatalogen inne i `sharelatex` containeren.
* Etter at du har endret dette og kjørt `bin/up -d`, vil loggfilene bli lagret på verten og være direkte tilgjengelige.

{% hint style="warning" %}
Du må sette eieren av vertens loggkatalog som brukes for bind-mounten til `www-data` brukeren (uid=33) og sørge for at tillatelsene er `drwxr-xr-x` (755).

Eksempel:

```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/on-premises-no/konfigurasjon/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.
