Logs
WX Logs Documentation
WX Logs is a free and simple utility that allows you to easily manage logging stuff with Discord webhook in your server with exports. This ensures your webhooks being safely stored on the server side and most importantly, in one place.
Setup
- Download the logs repository from GitHub
- Configure your webhooks in the config file
- Place the logs folder in your resources folder
- Ensure the resource
logs_config.lua
wx = {} -- Don't touch
wx.Webhooks = { -- Main config section
['deaths'] --[[ Webhook Name/ID that will be used in the export ]] = {
Username = "Player Deaths", -- Webhook username
Icon = '', -- Image URL that will be used in footer and profile picture
URL = '', -- Webhook URL
},
}
How to use
- Configure the webhooks in the config file
- Call the export in your resource on the server side:
exports.wx_lgos:SendLog(webhookName, {
description = "hello from wx_logs!"
}
)
- The
webhookName
is the name of the webhook you configured in the config file, for example above it'sdeaths
If you don't know how to create a webhook, check out this guide or our AntiCheat docs
Webhook options
- color (number): color code of the embed. You have to use Decimal numeral system, not Hexadecimal. You can use SpyColor for that. It has decimal number converter.
- author (table):
- name (string): name of author
- url (string): url of author. If name was used, it becomes a hyperlink
- icon_url (string): url of author icon
- title (string): title of embed
- url (string): url of embed. If title was used, it becomes hyperlink
- description (string): description text
- fields (array): array of embed field objects
- name (string): name of the field
- value (string): value of the field
- inline (boolean): if true, fields will be displayed in the same line, 3 per line, 4th+ will be moved to the next line
- thumbnail (table):
- url (string): url of thumbnail
- image (string): embed image object
- url (string): image url
- timestamp (string): ISO8601 timestamp (yyyy-mm-ddThh:mm:ss.msZ)
Example Usage
log.lua
local playerName, coords, reason
exports['wx_logs']:SendLog("death",{
username = "Player Deaths",
color = 16737095,
title = "Death",
fields = {
{
["name"]= "Player Name",
["value"]= playerName,
["inline"] = true
},
{
["name"]= "Coords",
["value"]= coords,
["inline"] = true
},
{
["name"]= "Death Cause",
["value"]= reason,
["inline"] = true
},
},
})