# Create logs

Set up the server's logs, get each one's link, choose the export key and see how long logs are kept.

Source: https://fivedash.fivex.gg/docs/en/logs/create-logs

Each FiveDash log is a drawer in the city's archive: **Deaths and combat**, **Inventory and chests**, **Store robbery**. Each one has a name, an icon, a key for the export and its own link to use in place of the Discord webhook. This page shows how to run the initial setup, create logs later, get the link, and edit or delete a log.

[Video: how to do it in under 20 seconds](https://fivedash.fivex.gg/docs/videos/logs-create-en.mp4)

## Before you start

* **Plan:** the Logs module in the organization's plan. How many logs a server can have depends on the plan: **15** on Plus, **30** on Pro and **60** on Ultra.
* **Access level:**

| What to do                                                            | Level needed                                                    |
| --------------------------------------------------------------------- | --------------------------------------------------------------- |
| Initial setup (the three steps)                                       | **All logs** at **Configure**                                   |
| Create a new log (**New log**)                                        | **All logs** at **Configure**, or **Create logs** at **Manage** |
| See the link, edit, generate a new link, send a test and delete a log | **Configure** on that log (or **All logs** at **Configure**)    |

> Whoever creates a log through **Create logs** automatically gets **Configure** on that log.

## Initial setup

The first time someone opens **Logs**, **Bring your logs to FiveDash** shows up, with three steps.

### Pick the logs

In **Which logs do your scripts send?**, tick the kinds the city uses (the list is in the table below). In **Other logs**, type a custom log's name in **Log name**, like "Store robbery", and click **Add**. Click **Create the link** (with more than one log, the button shows the number, like **Create 4 links**).

### Connect the scripts

Pick the **Discord webhook** or **FiveDash export** tab. For the webhook, copy each log's link and paste it into the script's config in place of the `discord.com/api/webhooks` link. For the export, copy each log's call. Click **I've swapped them** (webhook) or **Done** (export).

### Get the first log

Join the city and do something a script records, or click **Send a test log**. When the log arrives, it shows as the script sent it and what FiveDash read from it.

### Turn on the logs

Click **Turn on logs**. The button only unlocks after the first log has arrived. At the end, click **Go to the logs**.

> During setup, the first step's **Edit** button lets you change the list. A log you take off the list is deleted along with everything it received.

### Ready-made log kinds

| Log                        | Key            | What it's for                                |
| -------------------------- | -------------- | -------------------------------------------- |
| **Joins and leaves**       | `conexoes`     | Who connected, disconnected or dropped.      |
| **Chat and commands**      | `chat`         | Messages, /me and typed commands.            |
| **Deaths and combat**      | `mortes`       | Who killed whom, with what weapon and where. |
| **Inventory and chests**   | `inventario`   | Items taken, stored, dropped and sent.       |
| **Money and bank**         | `dinheiro`     | Transfers, withdrawals, deposits and fines.  |
| **Vehicles and garage**    | `veiculos`     | Spawns, purchases, sales and garages.        |
| **Police and prison**      | `policia`      | Arrests, searches, seizures and fines.       |
| **Staff actions**          | `staff`        | Admin commands: god, noclip, tp, item.       |
| **Factions and companies** | `organizacoes` | Chests, safes, hires and firings.            |
| **Anticheat**              | `anticheat`    | Automatic warnings and bans.                 |

A log from **Other logs** gets a key made from its name: "Store robbery" becomes `store-robbery`. If the key is taken, FiveDash adds `-2`, `-3` at the end.

## Create a log later

### Open the dialog

In the sidebar, under **Logs**, click **New log**.

### Give it an icon and a name

In **Icon and name**, pick the icon (you can search by name in **Search icons**) and type the name, like "Store robbery".

### Choose how the script sends

In **How the script sends**, pick **FiveDash export** (recommended) or **Discord webhook**. For the export, check the **Key**: it's filled in from the name and FiveDash tells you whether it's free.

### Create it

Click **Create log**. The dialog shows **Log created. Now just paste the link in the script.** (webhook) or **Log created. Now just call the export in the script.** (export), with the link or the code to copy. Click **Open log** to go to its page.

### Log fields

| Field                    | What it does                                                                                                                                                                                    | Default                                                                                  |
| ------------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------- |
| Icon                     | The log's icon in the sidebar and in the logs. Only changes on FiveDash.                                                                                                                        | **Record** (new log) or the kind's icon                                                  |
| Name                     | How the log shows in the panel. 2 to 40 characters, not repeating another log's name (case and accents don't count).                                                                            | —                                                                                        |
| **How the script sends** | **FiveDash export** or **Discord webhook**. Both ways keep working: this only changes the instructions FiveDash shows.                                                                          | **FiveDash export** for **New log**; **Discord webhook** for logs from the initial setup |
| **Key**                  | The name scripts use in the export: `exports.fivedash:log("key", …)`. 2 to 32 characters, only lowercase letters, numbers, `-` and `_`, starting with a letter or number. Unique on the server. | Made from the name                                                                       |
| Link                     | The address that goes in place of the Discord webhook. Unique per log.                                                                                                                          | Generated on creation                                                                    |

## The log's link

Each log's link has this format:

```http
https://logs.fivex.sh/api/logs/<log-id>/<token>
```

* `<log-id>` is the log's identifier (a UUID).
* `<token>` is a 43-character secret. Anyone with the link can send logs to the server.

To copy the link: open the log in the sidebar, click **How to send** at the top and use the copy button. If the log is on the export, first click **Use webhook** (under "Does the script already send to a Discord webhook?"). The link also shows in **Edit log**, in the **How to send** section. During the initial setup, the links are in the **Connect the scripts** step (**See links** button).

> Don't share the link. If it leaks, generate a new one (see below). Always copy the link from the panel instead of typing it.

## Edit a log

### Open the log

In the sidebar, under **Logs**, click the log.

### Open the editor

At the top, click the pencil (**Edit log**).

### Change and save

Change the icon, the name, **How the script sends** or the **Key** and click **Save**.

> The name and icon only change here on FiveDash. Changing the key means updating the scripts that use the export.

## Generate a new link

Use it when the link leaked or when you want to cut off an old script.

### Open the log's editor

Open the log and click **Edit log**. The option shows when **Discord webhook** is selected.

### Generate the link

In **How to send**, click **Generate new link** and confirm with **Generate new link**.

### Swap it in the scripts

Copy the new link and paste it into the scripts. The old one stopped working right away.

## Delete a log

Open the log, click **Edit log**, then **Delete log**, and confirm with **Delete for good**.

> Deleting a log erases every log it received, and the link stops working. This can't be undone.

## How long logs are kept

| Plan  | **Logs kept for** | **Logs received per month** | **Logs per server** |
| ----- | ----------------- | --------------------------- | ------------------- |
| Plus  | 7 days            | 1 million                   | 15                  |
| Pro   | 30 days           | 10 million                  | 30                  |
| Ultra | 90 days           | 50 million                  | 60                  |

The monthly logs limit covers the whole organization. The logs per server limit applies to each server.

## FAQ

**I got "Up to 15 logs per server on your plan." What do I do?**
The server reached the plan's log limit. Delete a log you no longer use, or change plans in **Settings → Plan**.

**I renamed the log. Do I need to change anything in the scripts?**
No. Name and icon are panel-only. Only the key (export) and the link (webhook) matter to scripts.

**The key says "Already used by the log …". Now what?**
Another log on the server already uses that key. Click the suggestion shown next to it or type another one.

## Next steps

[Replace Discord webhooks](https://fivedash.fivex.gg/docs/en/logs/migrate-from-webhooks)Paste the log's link into ready-made scripts.
[FiveM resource](https://fivedash.fivex.gg/docs/en/developers/fivem-resource)Send logs through the FiveDash export.
[Search and filter](https://fivedash.fivex.gg/docs/en/logs/search-and-filter)Find the logs that arrived.
[Team and permissions](https://fivedash.fivex.gg/docs/en/dashboard/team-and-permissions)Give each person access to a single log.
