JG Docs
Used Vehicles

Debug & Event Logging

Choose where JG Used Vehicles sends debug, audit and security logs

JG Used Vehicles separates debug output, normal audit events and security warnings. Configure the routes in two files:

  • config/config.lua controls whether each route is enabled and where it is sent.
  • config/config.webhooks.lua contains Discord webhook URLs and appearance settings.

Logging categories

RouteUsed for
LOGServer debug logs used while diagnosing an issue or when JG Scripts support asks you to enable them
EVENTNormal audit logs, such as dealership creation, stock acquisition, listing publication and high-value vehicle sales
SECURITYSuspicious requests and rate-limit warnings

Each route can be enabled and sent to different destinations independently.

Configure destinations

Set the destinations in config/config.lua:

config/config.lua
Config.Logs = {
  LOG = {
    enabled = true,
    destinations = { "console" }
  },
  EVENT = {
    enabled = true,
    destinations = { "ox_lib" }
  },
  SECURITY = {
    enabled = true,
    destinations = { "console", "ox_lib" }
  }
}

Supported destinations are:

DestinationDescription
consolePrints to the server console
ox_libSends to lib.logger, which uses the logging service configured for ox_lib
discordSends to the matching Discord webhook URL in config/config.webhooks.lua

You can send one route to more than one destination. This sends normal events to both ox_lib and Discord:

config/config.lua
Config.Logs = {
  LOG = {
    enabled = true,
    destinations = { "console" }
  },
  EVENT = {
    enabled = true,
    destinations = { "ox_lib", "discord" }
  },
  SECURITY = {
    enabled = true,
    destinations = { "console", "ox_lib" }
  }
}

Set enabled = false to disable a route:

config/config.lua
Config.Logs = {
  LOG = {
    enabled = false,
    destinations = { "console" }
  },
  EVENT = {
    enabled = true,
    destinations = { "ox_lib" }
  },
  SECURITY = {
    enabled = true,
    destinations = { "console", "ox_lib" }
  }
}

Config.Debug is separate from server logging. It controls client-side debug output and visual target or zone debugging. The Config.Logs.LOG route controls server debug logs.

Configure Discord webhooks

Discord webhook URLs are stored in config/config.webhooks.lua. This file is loaded on the server only.

config/config.webhooks.lua
Webhooks = {}

Webhooks.BusinessCreation = ""
Webhooks.Acquisition = ""
Webhooks.Listing = ""
Webhooks.HighValueSale = ""
Webhooks.SuspiciousAction = ""
Webhooks.Debug = ""

Webhooks.HighValueSaleMinimum = 500000

Webhooks.DiscordSettings = {
  username = "JG Used Vehicles Webhook",
  avatarUrl = "https://forum.cfx.re/user_avatar/forum.cfx.re/jgscripts/288/3621910_2.png",
  webhooks = Webhooks,
  colors = {
    success = 0x2ecc71,
    danger = 0xe74c3c,
    warning = 0xf1c40f,
    debug = 0x3498db,
    default = 0xff6700
  }
}

Discord logs are sent only when the route includes the discord destination and the matching webhook URL is set. A blank URL skips that Discord log without stopping the other destinations.

WebhookRouteUsed for
Webhooks.BusinessCreationEVENTUsed dealership creation
Webhooks.AcquisitionEVENTVehicles acquired into used stock
Webhooks.ListingEVENTPrivate and dealership listings
Webhooks.HighValueSaleEVENTCompleted sales at or above Webhooks.HighValueSaleMinimum
Webhooks.SuspiciousActionSECURITYSuspicious requests and rate-limit warnings
Webhooks.DebugLOGDebug output when the LOG route includes discord

Webhooks.HighValueSaleMinimum is the minimum sale value in your base currency for a HighValueSale log. It does not change vehicle prices, fees or payouts.

Migrate existing Discord webhooks

Back up the old webhook file

Before updating the resource, keep a copy of your existing server/sv-webhooks.lua file. It contains the webhook URLs and high-value sale threshold you need to move.

Replace the old webhook file

Copy the updated resource files into place, including the new server/sv-webhooks.lua. Don't restore the whole contents of your old file afterwards. An old copy can overwrite the new webhook configuration with blank URLs.

The new file keeps the old Webhooks.Server.Send and Webhooks.Server.SendBusinessAudit functions available for existing server customisations. It forwards those calls to the central logger. Store all webhook URLs in config/config.webhooks.lua from now on.

Move the webhook URLs

Copy each URL into the matching entry in config/config.webhooks.lua:

Old settingNew setting
Webhooks.BusinessCreationWebhooks.BusinessCreation
Webhooks.AcquisitionWebhooks.Acquisition
Webhooks.ListingWebhooks.Listing
Webhooks.HighValueSaleWebhooks.HighValueSale
Webhooks.SuspiciousActionWebhooks.SuspiciousAction

Webhooks.Debug is new. Leave it blank unless you want LOG entries sent to Discord.

Move the high-value sale threshold

Copy the old threshold into the same setting in config/config.webhooks.lua:

config/config.webhooks.lua
Webhooks.HighValueSaleMinimum = 500000

Replace 500000 with the value from your old server/sv-webhooks.lua file.

Enable Discord destinations

Add discord to each route that should send webhook logs. This configuration preserves the old Discord event and security logs while keeping debug logs in the console:

config/config.lua
Config.Logs = {
  LOG = {
    enabled = true,
    destinations = { "console" }
  },
  EVENT = {
    enabled = true,
    destinations = { "discord" }
  },
  SECURITY = {
    enabled = true,
    destinations = { "discord" }
  }
}

Restart and test

Restart jg-usedvehicles. Trigger one configured event and confirm it reaches the selected destination. For Discord, create a test listing or another event that matches a webhook URL you added.

Customise Discord appearance

Edit Webhooks.DiscordSettings in config/config.webhooks.lua to change the webhook username, avatar and embed colours:

config/config.webhooks.lua
Webhooks.DiscordSettings = {
  username = "JG Used Vehicles Webhook",
  avatarUrl = "https://forum.cfx.re/user_avatar/forum.cfx.re/jgscripts/288/3621910_2.png",
  webhooks = Webhooks,
  colors = {
    success = 0x2ecc71,
    danger = 0xe74c3c,
    warning = 0xf1c40f,
    debug = 0x3498db,
    default = 0xff6700
  }
}

Last updated 29 August 2026

On this page