Discord logging

We've integrated Discord Logging straight out of the box. You'll be able to receive logs straight into a channel for everything that happens in-game with the resource, from starting fires to toggling automatic fires.

To begin, navigate to your Discord Server and make a new channel or choose an existing one where the logs should be sent to.

Next, follow this tutorial by Discord to create a Webhook Integration.

Now you have created a webhook, copy this and open the sv_utils.lua file. At the top, you should see:

main.logging.webhook = "https://discord.com/api/webhooks/"

Paste your webhook within the speech marks and you can now move on to configuring the contents and appearance of the webhooks.

To do this, navigate back to the config.lua file and find the section titled logging = {.

logging = {
        enabled = true,
        displayName = "Smart Fires",
        colour = 31487,
        title = "**New Log**",
        icon = "https://i.imgur.com/n3n7JNW.png",
        footerIcon = "https://i.imgur.com/n3n7JNW.png",
        dateFormat = "%d-%m-%Y %H:%M:%S", -- Day-Month-Year Hour-Minute-Second
},

If you want to enable logging, make sure this is enabled as such in the config under the logging section.

The displayName property determines the name that the webhook will use when logging events from the resource into your selected channel.

The colour property sets the colour of the embedded messages. This uses a decimal colour system, you can select a colour here. This is different to hexadecimal so ensure you have copied the right value after selecting a colour.

The title simply sets the title of the logs.

The icon and footerIcon properties decide the images that are displayed, one of which is in the footer and one larger, next to the logged data. By default, we've configured this to the London Studios logo.

The dateFormat property allows you to decide how the date and time is formatted in the timestamp part of the log, showing you the exact time of the action. You can configure this to just show the date for example, removing hours, minutes and seconds if you wish to do so.

Last updated