> For the complete documentation index, see [llms.txt](https://prisma-logs.gitbook.io/prisma-logs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://prisma-logs.gitbook.io/prisma-logs/docs/en/configuration/export.md).

# Export for developers

Send a log from your own scripts with the `sendLogging` export. This only works **server side**.

```lua
exports['prisma-logs']:sendLogging(category, data)
```

* `category`: the name of a category in your panel. Create it first under **Categories → Add Category**.
* `data`: a table. The keys must have the same names as the fields of the category.

{% hint style="info" %}
Every category you made has a **Code** button in the panel. It shows the right code for that category, ready to copy.
{% endhint %}

## Example: logging a command

Category `commands` with the fields `identifier`, `name`, `command` and `args`:

```lua
RegisterCommand('car', function(source, args)
    exports['prisma-logs']:sendLogging('commands', {
        identifier = GetPlayerIdentifierByType(source, 'license'),
        name = GetPlayerName(source),
        command = '/car',
        args = table.concat(args, ' '),
    })
    -- rest of your command
end, false)
```

## Example: QBCore

```lua
local QBCore = exports['qb-core']:GetCoreObject()

RegisterNetEvent('myshop:server:buy', function(item, price)
    local src = source
    local Player = QBCore.Functions.GetPlayer(src)
    exports['prisma-logs']:sendLogging('shop', {
        identifier = Player.PlayerData.license,
        name = Player.PlayerData.charinfo.firstname .. ' ' .. Player.PlayerData.charinfo.lastname,
        item = item,
        price = price,
    })
end)
```

## Good to know

* Tables in `data` are turned into text automatically.
* Logs are collected and sent in batches, the export never waits.
* A category that doesn't exist is rejected, the log won't show up in the panel.
* Put `ensure prisma-logs` above your own scripts in `server.cfg`.


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://prisma-logs.gitbook.io/prisma-logs/docs/en/configuration/export.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
