> ## Documentation Index
> Fetch the complete documentation index at: https://docs.awokenlabs.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Discord logging

> Audit banking activity to a Discord webhook - deposits, transfers, cards, loans, tax, and admin commands, per category.

Awoken Banking can **audit-log** to a Discord webhook: money movements, cards, loans, tax, tier upgrades, and admin command usage. It's **off by default** and consumes the same banking events your scripts can hook, so it adds no load when disabled. Everything here is in `config/webhooks.lua` (the table is `Config.Logging`).

## Turning it on

Set `enabled = true` and give it a `webhook` URL. That URL is the default destination for every enabled category.

```lua config/webhooks.lua theme={"dark"}
Config.Logging = {
    enabled = true,
    webhook = 'https://discord.com/api/webhooks/...',
}
```

## Categories

Each category is toggled on its own. Two default to off because they're noisy on a busy server.

```lua config/webhooks.lua theme={"dark"}
categories = {
    transactions = true,    -- deposits / withdrawals
    transfers    = true,
    accounts     = true,    -- shared accounts opened / closed
    cards        = true,    -- issued / frozen / deleted / PIN changed
    loans        = true,    -- taken / paid / paid off / defaulted
    credit       = false,   -- credit score changes (noisy)
    tax          = true,    -- tax collected
    interest     = false,   -- interest payouts (noisy)
    tiers        = true,    -- account tier upgrades
    admin        = true,    -- admin command usage
},
```

| Category       | What it logs                                | Default         |
| -------------- | ------------------------------------------- | --------------- |
| `transactions` | Deposits and withdrawals.                   | On              |
| `transfers`    | Money moved between accounts.               | On              |
| `accounts`     | Shared accounts opened and closed.          | On              |
| `cards`        | Cards issued, frozen, deleted, PIN changed. | On              |
| `loans`        | Loans taken, paid, paid off, defaulted.     | On              |
| `credit`       | Credit score changes.                       | **Off** (noisy) |
| `tax`          | Tax collected.                              | On              |
| `interest`     | Savings interest payouts.                   | **Off** (noisy) |
| `tiers`        | Account tier upgrades.                      | On              |
| `admin`        | Admin command usage.                        | On              |

## Per-category webhooks

Send some categories to a different channel by overriding their URL in `webhooks`. Anything without an override uses the default `webhook` above - a common setup is a public feed for money and a private one for `admin`.

```lua config/webhooks.lua theme={"dark"}
webhooks = {
    transactions = 'https://discord.com/api/webhooks/...',
    admin        = 'https://discord.com/api/webhooks/...',   -- staff-only channel
},
```

<Note>
  The `admin` category logs staff command usage. Admin commands are gated behind the ace `command.awoken_banking` - grant it however your server scopes admin, e.g. `add_ace group.admin command.awoken_banking allow` in `server.cfg`.
</Note>

<Tip>
  Everything logged here is also emitted as a server [event](/resources/awoken-banking/events), so if you'd rather build your own logging (a database, a different service, a richer embed) you can hook the events directly instead of using this.
</Tip>
