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

# Logging

> Record what happens in your server — messages, members, roles, channels, voice and moderation.

Logging records server events to a channel. Events are grouped into categories so you can enable a whole area at once, or pick individual events and split them across several channels.

Requires **Manage Server**.

## Setting it up

<CodeGroup>
  ```javascript Everything to one channel theme={null}
  !logging enable #server-logs
  ```

  ```javascript Specific categories theme={null}
  !logging enable #message-logs message
  !logging enable #member-logs member role
  ```

  ```javascript Individual events theme={null}
  !logging enable #logs message_delete member_join
  ```
</CodeGroup>

With no events listed, **every** event is enabled. Aliases: `add`, `set`, `on`.

```javascript theme={null}
!logging disable #logs voice
!logging view #logs
!logging list
```

`view` shows what one channel logs; `list` shows every logging channel and its events. Aliases for `disable`: `delete`, `remove`, `del`, `rm`, `off`.

## Events

Enable a **category** name to get everything under it, or name individual events.

<AccordionGroup>
  <Accordion title="message" icon="message">
    | Event                 | Fires on                    |
    | --------------------- | --------------------------- |
    | `message_delete`      | A message is deleted        |
    | `message_edit`        | A message is edited         |
    | `message_bulk_delete` | Several are deleted at once |

    The highest-volume category by a wide margin. Give it a dedicated channel.
  </Accordion>

  <Accordion title="member" icon="user">
    | Event                | Fires on                   |
    | -------------------- | -------------------------- |
    | `member_join`        | Someone joins              |
    | `member_leave`       | Someone leaves             |
    | `member_update`      | Nickname or avatar changes |
    | `member_role_update` | Roles added or removed     |
  </Accordion>

  <Accordion title="role" icon="user-tag">
    | Event         | Fires on          |
    | ------------- | ----------------- |
    | `role_create` | A role is created |
    | `role_delete` | A role is deleted |
    | `role_update` | A role is changed |
  </Accordion>

  <Accordion title="channel" icon="hashtag">
    | Event            | Fires on             |
    | ---------------- | -------------------- |
    | `channel_create` | A channel is created |
    | `channel_delete` | A channel is deleted |
    | `channel_update` | A channel is changed |
  </Accordion>

  <Accordion title="invite" icon="link">
    | Event           | Fires on             |
    | --------------- | -------------------- |
    | `invite_create` | An invite is created |
    | `invite_delete` | An invite is deleted |
  </Accordion>

  <Accordion title="emoji" icon="face-smile">
    `emoji_create`, `emoji_update`, `emoji_delete`
  </Accordion>

  <Accordion title="sticker" icon="note-sticky">
    `sticker_create`, `sticker_update`, `sticker_delete`
  </Accordion>

  <Accordion title="voice" icon="microphone">
    | Event          | Fires on                             |
    | -------------- | ------------------------------------ |
    | `voice_join`   | Joining a voice channel              |
    | `voice_leave`  | Leaving one                          |
    | `voice_move`   | Moving between channels              |
    | `voice_update` | Mute, deafen or stream state changes |
  </Accordion>

  <Accordion title="moderation" icon="gavel">
    `moderation` isn't in a category — enable it by name. It logs every [case](/moderation/cases): bans, kicks, mutes, jails, timeouts and warns, each with its case number and an editable reason.

    ```javascript theme={null}
    !logging enable #mod-logs moderation
    ```

    Almost every server wants this in its own channel.
  </Accordion>
</AccordionGroup>

## A recommended layout

Split by volume and audience:

```javascript theme={null}
!logging enable #message-logs message
!logging enable #member-logs member invite
!logging enable #server-logs role channel emoji sticker
!logging enable #voice-logs voice
!logging enable #mod-logs moderation
```

Message logs are noisy and rarely read except when investigating something specific. Moderation logs are read constantly. Keeping them apart makes both more useful.

<Tip>
  If you only set up one, make it `moderation`. It's the smallest and the one you'll actually go back through.
</Tip>

## What gets recorded

Deleted messages keep their content, author, channel and attachments where mira had them cached. Edits show before and after. Role changes show exactly which roles moved, and who did it when the audit log makes that available.

<Warning>
  A bot can only log what it can see. Messages sent before mira joined, or in channels it can't view, aren't recoverable — no bot can do this, it's a Discord limitation rather than a missing feature.

  Make sure mira has **View Channel** and **Read Message History** everywhere you want logging to work.
</Warning>

## Related

* [Cases](/moderation/cases) — the record behind `moderation` log entries
* [Snipe](/utility/everyday#snipe) — recover a deleted message without opening the logs
* [Server insight](/utility/server-insight) — aggregate activity rather than individual events
* [Audit log](/utility/server-insight#name-and-avatar-history) — name and avatar history tracked separately

## Command reference

| Command                              | Aliases                   | Description                |
| ------------------------------------ | ------------------------- | -------------------------- |
| `logging enable <channel> [events]`  | `add`, `set`, `on`        | Enable events in a channel |
| `logging disable <channel> [events]` | `delete`, `remove`, `off` | Disable events             |
| `logging view <channel>`             | `events`                  | What one channel logs      |
| `logging list`                       | `ls`                      | Every logging channel      |

Every command requires **Manage Server**. Group aliases: `logger`, `logs`, `log`.
