View Source Getting Started

This guide is an introduction to DiscoLog. It will guide you through the setup of DiscoLog and how to use it.

Install DiscoLog

The first step is to add DiscoLog to your applicaiton is to declare the package as a dependency in your mix.exs file.

defp deps do
  [
    {:disco_log, "~> 0.7.0"}
  ]
end

Then run the following command to fetch the dependencies.

mix deps.get

Setup the Discord Server

You need to register a Discord Account

Create a community Discord Server

A Discord community server needs to have a forum-type channel, which we use for error tracking.

Create Server step 1Create Server step 2Create Server step 3

Edit the Discord Server settings

Right-click on the server and select Server Settings > Community Settings

Edit Server step 4Edit Server step 5Edit Server step 6Edit Server step 7Edit Server step 8

Copy the server ID, it will be needed later

+If you don't see Copy Server ID in the UI, enable developer mode in Settings -> Advanced -> Developer Mode.

Edit Server step 9

Create a Discord Bot

Go to the developers portal

Create bot 1Create bot 2

Disable User Install and add the scope bot and the permissions Attach Files, Manage Channels, Manage Threads, Send Messages, Send Messages in Threads

Bot settings

Generate and copy the bot token, it will be needed later

Bot token

Add Bot to your Server

Go to the installation menu and open the installation link

Instal Bot on your server step 1

Follow the steps

Instal Bot on your server step 2Instal Bot on your server step 3Instal Bot on your server step 4

Create DiscoLog channels

Edit your config/dev.exs and add the following configuration with the bot token and the server ID you copied earlier.

config :disco_log,
  otp_app: :app_name,
  token: "YOUR_BOT.TOKEN",
  guild_id: "YOUR_SERVER_ID"

Run the mix task

mix disco_log.create

It will create and output the rest of the necessary configuration for you. Use this configuration for your production environment or add it to your dev config if you want to test.

Confirm that everything is working smoothly by running the following mix command it will put a log in each channels.

mix disco_log.sample

How it should look like

Sample log 1Sample log 2Sample log 3

After setup

When you confirmed that the setup is working you should put this config to disable DiscoLog in dev.exs and test.exs env.

config :disco_log,
  enable: false

Enjoy using DiscoLog!