What Discord keeps
Discord's audit log (Server Settings, Audit Log) records staff actions: bans, channels created, roles edited. It doesn't show the content of a deleted message, nor messages a member deletes themselves. Once a message is deleted, it is lost, unless a bot logged it first.
Create the logs channels
With AshBots, type /log logsetup. The bot creates a private category, visible only to staff, with one channel per log.
Choose what gets logged
/log logs opens the panel. Seven logs can be enabled separately: Messages (deletions, edits), Members (joins, leaves, nicknames), Moderation, Channels, Roles, Voice and Server. A channel or a role can be excluded.
Find a message
From then on, every deleted or edited message appears in the Messages channel, with its author and content. /log snipe shows the last deleted message in the channel. On the dashboard, the Logs tool filters by member and by period.
Check that everything works
/log logstest sends a test to each channel and reports permission problems. The details are on the Discord logs bot page.