> 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/da/konfiguration/overleaf-toolkit/logging.md).

# Logføring

Du kan bruge `bin/logs` scriptet til at se logfiler for tjenesterne.

Grundlæggende brugseksempler:

```bash
# Se webtjenestens logfiler
bin/logs web

# Vis hjælp
bin/logs --help

# Se logfiler for flere tjenester på én gang
bin/logs filestore docstore web clsi

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

# Begræns antallet af udskrevne linjer (standard 50)
bin/logs -n 50 web

# Vis alle loglinjer
bin/logs -n all web

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

Du kan bruge `bin/logs` scriptet til at se logfiler 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 af logfiler

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

Kopiér logfiler fra den primære `sharelatex` container til din lokale computer:

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

## Bevarelse af logfiler

Docker-containere er midlertidige, hvilket betyder, at filer/mapper, der oprettes inde i containeren under kørsel (inklusive logfiler), vil blive slettet, hvis containeren oprettes igen (for eksempel når der køres `bin/up`). For at bevare logfiler mellem genskabelser af containere:

* Angiv miljøvariablen `OVERLEAF_LOG_PATH` i `config/overleaf.rc` filen, der bruges af Toolkit. Dette bør være den mappe på værten, som vil blive bind-monteret til logmappen inde i `sharelatex` containeren.
* Efter at have ændret dette og kørt `bin/up -d`, vil logfiler blive bevaret på værten og være direkte tilgængelige.

{% hint style="warning" %}
Du skal sætte ejeren af logmappen på værten, der bruges til bind-mounten, til `www-data` brugeren (uid=33) og sikre, at rettighederne 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://overleaf-pro.ayaka.space/on-premises/da/konfiguration/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.
