Discord bot logs

Does anybody know how to make the bot send logs? Like if someone gets kicked, banned, muted, role changes etc the bot automatically logs the changes in a channel?