Skip to main content

Server log

A record of what happened in your Discord server, written as it happens.

The four categories​

Every event belongs to one of four groups, and each can go to its own channel.

CategoryCovers
MessagesDeleted, purged and edited messages
MembersJoins, leaves, bans, unbans, nicknames, roles, timeouts, username changes
Server structureChannels, threads, roles, emoji, stickers, invites, webhooks, server settings
VoiceJoining, leaving, moving between channels, and state changes

Set a channel per category, or set one channel and let all four fall back to it. Splitting them is worth it as soon as the message log starts burying everything else, which it does in any busy server.

Choosing what it records​

Each event can be switched off on its own, not only by category. A server that wants deletions but not edits can have exactly that.

Use /serverlog to set the channels and pick the events.

Two rules it always follows​

It never names somebody it is not sure about. Discord does not tell a bot who deleted a message. When the audit log can answer, the entry names them. When it cannot, the field is simply absent.

An entry that sometimes invents an actor is worse than one that leaves it out, because you cannot tell which kind you are reading. So a missing name means unknown, and it always means unknown.

It never breaks the server it is logging. Every listener is wrapped. A logger that can take down the thing it watches is not a logger, and one listener raising would take the rest of that event's handlers with it.

Things it does deliberately​

A channel is named so the entry survives the channel. Entries carry the mention, the name and the id together. The mention resolves while the channel exists and the stored name reads fine after it does not, which is exactly the case a deletion log has to survive.

Bulk changes are one entry. A member handed fifteen roles by an automation is one line naming the first several and counting the rest, rather than fifteen lines.

When you are stuck

Nothing is being logged

The module is off, or no channel is set. Both are silent by design: a logger that complained in chat about not being configured would be worse than one that waited.

Deleted messages are logged but never say who deleted them

Discord only tells a bot that through the audit log, and only sometimes. The name is left out rather than guessed. Check the bot can read the audit log if it is never present.

Everything lands in one channel

Only the fallback channel is set. Set a channel per category to split them.

Message edits are flooding the channel

Turn that one event off. Events are switchable individually, not only by category.

Voice entries are missing

Voice needs the voice state intent. If the rest of the log works and voice does not, that is the reason.