docs(help): document backend logs retention

This commit is contained in:
Elian Doran
2025-08-13 16:07:13 +03:00
parent 43fd0924a1
commit 221ab02c24
19 changed files with 501 additions and 175 deletions

View File

@@ -1,28 +1,10 @@
# Error logs
It's important to provide all available error logs together with bug reports. This page will show you how to do it.
It's important to provide all available error logs together with bug reports.
## Backend logs
There are two types of error logs, both of which are useful when reporting bugs.
Open [data directory](../Installation%20%26%20Setup/Data%20directory.md), go to `log` subdirectory and find the latest log file, e.g. `trilium-2022-12-14.log`. You can attach the whole file to the bug report (preferable) or open it and copy-paste only the last lines / lines you believe are relevant.
If you have trouble finding it the log files, there's also an in-app option in top-left menu button -> Advanced -> Show backend log.
## Frontend logs
To provide frontend logs, we need to open the Developer Console. Often the easiest way is to press <kbd>Ctrl</kbd>\-<kbd>Shift</kbd>\-<kbd>I</kbd> which should work in most browsers (and desktop app). Make sure that the error producing action happened right before you copy&paste the errors, the console is cleared on app restart.
If that doesn't work, then:
* in Trilium desktop app, go to top-left menu button -> Advanced -> Open Dev Tools
* In Firefox/Chrome right-click anywhere in the page and click Inspect:
![](Error%20logs_error-logs-fire.png)
Once you have Dev Tools open, click on "Console" tab:
![](Error%20logs_image.png)
Copy-paste (or screenshot) the logs. It's better to provide not just errors, but the whole log, which might provide context while analyzing the bug.
* <a class="reference-link" href="Error%20logs/Backend%20(server)%20logs.md">Backend (server) logs</a>
* <a class="reference-link" href="Error%20logs/Frontend%20logs.md">Frontend logs</a>
## Providing sensitive data

View File

@@ -0,0 +1,28 @@
# Backend (server) logs
## Accessing via the backend log
In the <a class="reference-link" href="../../Basic%20Concepts%20and%20Features/UI%20Elements/Global%20menu.md">Global menu</a>, go to Advanced → Show backend log
## Location on the disk
Backend logs are stored on the file system. To find them, open the <a class="reference-link" href="../../Installation%20%26%20Setup/Data%20directory.md">Data directory</a>, go to the `log` subdirectory and find the latest log file, e.g. `trilium-2022-12-14.log`. 
## Reporting backend bugs
You can attach the whole file to the bug report (preferable) or open it and copy-paste only the last lines / lines you believe are relevant.
## Customizing the retention of logs
The backend logs are fully managed by the Trilium server. By default the last 90 days worth of logs are kept; the logs older than that are deleted in order to reduce the space consumption.
It's possible to change the retention period by modifying the <a class="reference-link" href="../../Advanced%20Usage/Configuration%20(config.ini%20or%20e.md">Configuration (config.ini or environment variables)</a> via the `.ini` file:
```
[Logging]
retentionDays=7
```
Or via the environment variable `TRILIUM_LOGGING_RETENTION_DAYS`.
> [!NOTE]
> If you set the retention days to a low number, you might notice that not all the log files are being deleted. This is because a minimum number of logs (7 at the time of writing) is maintained at all times.

View File

@@ -0,0 +1,15 @@
# Frontend logs
To provide frontend logs, we need to open the Developer Console. Often the easiest way is to press <kbd>Ctrl</kbd>\-<kbd>Shift</kbd>\-<kbd>I</kbd> which should work in most browsers (and desktop app). Make sure that the error producing action happened right before you copy&paste the errors, the console is cleared on app restart.
If that doesn't work, then:
* in Trilium desktop app, go to top-left menu button -> Advanced -> Open Dev Tools
* In Firefox/Chrome right-click anywhere in the page and click Inspect:
![](Frontend%20logs_error-logs-f.png)
Once you have Dev Tools open, click on "Console" tab:
![](Frontend%20logs_image.png)
Copy-paste (or screenshot) the logs. It's better to provide not just errors, but the whole log, which might provide context while analyzing the bug.

View File

Before

Width:  |  Height:  |  Size: 136 KiB

After

Width:  |  Height:  |  Size: 136 KiB