> For the complete documentation index, see [llms.txt](https://docs.fivemstats.net/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.fivemstats.net/panel/server-logs.md).

# Server Logs

Search the log lines your scripts and the game script write, and delete old ones.

Every log line your scripts write ([Log API](https://docs.fivemstats.net/tgiann-fivem-stats-script/for-developers/log-api.md)), plus the automatic logs turned on in [Settings > Logs](https://docs.fivemstats.net/panel/settings.md#logs).

## Filters

| Filter              | What it does                                                                                                                                   |
| ------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |
| **Dataset**         | The log group, like `connections`, `txadmin` or your own `bank`. Scripts name it in `exports.Log`. **All datasets** shows every group together |
| **Levels**          | debug, info, warn, error                                                                                                                       |
| **Resource**        | The resource that wrote the line. **All resources** shows every one                                                                            |
| **Search messages** | Text inside the message                                                                                                                        |
| **Player**          | Lines about this character, as the one acting or the target (their `playerSource` or `targetSource`)                                           |
| **Time range**      | Lines from a time window                                                                                                                       |

Type in the **Dataset** and **Resource** lists to search them. To clear one, pick **All datasets** or **All resources** at the top of the list. With all datasets shown, each line also shows its dataset.

Click a line to open its metadata and trace id. **Live** adds new lines as they happen. The list exports to PDF, Excel, CSV and JSON.

## Delete old logs

Only the server's owner sees **Delete old logs**.

1. Click **Delete old logs**.
2. Set **Older than** to the days to keep.
3. With a dataset selected, choose **From**: every dataset or only that one.
4. Click **Delete logs**, then **Yes, delete them**.

{% hint style="danger" %}
The lines are deleted from the game server for good. This cannot be undone.
{% endhint %}

The lines are deleted on the game server in the background, a little at a time so new logs keep coming in. A small delete is done in seconds, millions of lines take minutes. To delete old lines every day, set **Delete old logs** in [Settings > Logs](https://docs.fivemstats.net/panel/settings.md#logs).

## A line is missing

* Lines below **Lowest level kept** are dropped before they are stored, see [Settings > Logs](https://docs.fivemstats.net/panel/settings.md#logs).
* Lines older than **Delete old logs** in [Settings > Logs](https://docs.fivemstats.net/panel/settings.md#logs) are deleted once a day.
* Check the dataset: each script chooses its own. **All datasets** shows them all.
