Set up a Discord audit log bot for server activity
Use the Free Logging module to post server activity and moderator actions in a private Audit Log Channel. Give moderators a place to review message changes without filling a public chat with logs. This guide also configures message edits and single-message deletions, then checks each event with a harmless test message.
Start freeStart free. Pro is $9.99/month.
Before you start
- Use an existing Build Discord Bots bot that is invited to your server and online. You need access to its module settings.
- Prepare a text channel for logs, such as #server-log. Restrict member access as appropriate, while allowing the bot to view the channel, send messages and embed links. Use the English dashboard labels for these steps.
- Enable Server Members Intent in your application's Discord Developer Portal for server joins, leaves and member changes. Enable Message Content Intent for message text and prefix commands. Grant the bot the server-wide View Audit Log permission so it can look up who took a moderator action.
Open the Logging module
Open your bot from the dashboard and choose Modules. Find Logging and turn its toggle on if needed. Wait for any restart caused by enabling the module to finish.
If the setup wizard appears, choose Skip for now. Click the Logging card's gear button titled Settings to open Module Settings, headed Configure Logging. Choose your server in the Server selector.
Choose the Audit Log Channel
Select your moderation log channel in Audit Log Channel. The option None (logging output disabled until selected) does not provide a destination, even if event switches are enabled.
If the channel list cannot load, paste the channel ID into the field. Check the channel permissions in Discord: a private channel must still be accessible to the bot.
Enable the two message events
Set up these switches for the message edit and deletion test later in the guide.
For a new configuration, use Disable all under Quick Presets to begin with no events selected. If you are editing an existing configuration, keep any other events your moderators still need instead of resetting them.
In Messages, turn on Message Edits and Message Deletions. Bulk Deletions is a separate event; it is not needed for this single-message test. To identify moderator deletions where Discord can record them, turn on Show who deleted messages and grant the bot the server-wide View Audit Log permission. To log bans, unbans, confirmed kicks, timeouts, member role and nickname changes, and channel creation or deletion with the moderator, turn on Moderator actions; its channel starts as the Audit Log Channel and it also needs View Audit Log. When Discord has no matching audit entry, the log says Moderator unknown. Review the enabled-event count before saving.
Choose what to track in your server activity log
Under Members, enable Member Joins and Member Leaves. Turn on Moderator actions (needs View Audit Log) for member role changes, timeouts and channel creation or deletion. These settings are available on Free.
Leave Moderator actions channel at its default to send these actions to the Audit Log Channel. If you choose a separate staff channel, give the bot View Channel, Send Messages and Embed Links there too.
On Pro, use the Server group for extra events such as Channel Updated for channel renames or Role Created for new server roles. In the Voice group, choose Voice Joins, Voice Leaves or Voice Moves to track activity in voice channels.
Save the server configuration
Confirm the Server selector still points to the intended server, then click Save Settings. Wait for Saved ✓. If the dashboard reports that live sync failed, use Restart on the bot page and wait for it to be online before testing.
Reopen Settings if you need to check the saved Audit Log Channel or event switches. Settings are saved for the selected server, so repeat the configuration separately for another server.
Check the Audit Log Channel from Discord
With Manage Server, you can configure the same destination in Discord. Run !logchannel #server-log using your channel's actual mention. Run !logtoggle memberjoin on to enable Member Joins and !logs to review the saved configuration. If your bot uses a different prefix, replace ! in these commands.
Run !testlog and look for the test embed in the Audit Log Channel. Then trigger real events to check the switches and moderator attribution.
Test a member role change and a moderator action
In a test server, assign a harmless role to a test member. Look for an entry that lists the member and the added role. Then apply a short timeout to the same test member and look for a separate timeout entry. With Moderator actions enabled, both entries go to its configured channel, which defaults to the Audit Log Channel.
The bot names the moderator when it finds a recent matching Discord audit entry. If it cannot identify the actor, the entry says Moderator unknown. Check View Audit Log if you expected a name. A member departure is reported as a kick only when the bot finds a matching kick entry.
Check an edit and a deletion in Discord
While the bot is online, send a harmless message from a human account in a channel the bot can see. Edit its text, then check the Audit Log Channel for a message-edit entry. Delete that single message and check for a deletion entry. A moderator deletion may identify that moderator; Discord does not audit self-deletes, so a self-delete correctly says the deleter is the author or unknown. If you turned on Moderator actions, its entries name the moderator only when Discord records a recent matching audit entry, and a member leave is called a kick only when Discord records a matching kick.
If entries are missing, check the destination permissions, the Server selection and both event switches. Also check that the Discord application's Message Content intent is enabled if message text is missing. Test with a fresh message after correcting the configuration.
Frequently asked questions
Why are switches enabled but no logs appear?
Select an Audit Log Channel as well as event types, save for the correct Server, and make sure the bot is online and can send embeds in that channel. Test with a new message from a human account.
Does Message Deletions include a bulk purge?
Bulk Deletions is a separate switch in Messages. This guide tests a single-message deletion; configure the bulk event separately if you need it.
Will logs always contain the original message text?
No. The module uses a limited in-memory cache. If the content was not available or cached, including after a restart, the original text may be missing. Logging is not a complete message backup.
Why does the deleter say author or unknown?
Discord records moderator message deletions in its audit log, but does not record self-deletes. The module only names a deleter when it finds a recent matching audit entry for the channel and message author; it never guesses. Check that Show who deleted messages is on and the bot has View Audit Log.
