Docs
APILog inDeploy a serverDeploy

Send logs from ox_lib

Switch ox_lib's logger, which ox_inventory, qbx_core and anything on lib.logger use, to fxvault Logs with convars alone, through the fxvault resource so no batch is lost.

Media Storage2 min readUpdated

On this page
  1. With the Loki provider, through the fxvault resource
  2. Without the fxvault resource
  3. With the Datadog provider
  4. Request rate
  5. Check it

ox_lib's logger switches with convars. No script is edited. Everything that logs through lib.logger, including ox_inventory and qbx_core, starts sending to fxvault Logs.

Open your team's Setup tab and choose Server logs to get these lines with your key filled in. Use a key with Send logs only: the Game server logs preset on the API keys tab.

With the Loki provider, through the fxvault resource

This is the setup to use. ox_lib posts to the fxvault resource on the same server, which answers at once and sends the lines on in batches, retrying until they arrive. ox_lib never prints unable to submit logs ... (status: 0), and a slow moment on the network loses nothing. It needs fxvault 1.2.1 or later.

In server.cfg:

Config
ensure fxvault                   # above ox_lib and every resource that logs
set ox:logger "loki"
set loki:endpoint "http://127.0.0.1:30120/fxvault"
set loki:user "fxvault"          # any text: without it ox_lib sends no key
set loki:key "fxv_..."
# set loki:tenant "your-dataset"  # optional: the dataset these logs go to
  • Use your server's port in loki:endpoint (30120 unless you changed it), with http, not https. If your server listens on one address only (endpoint_add_tcp "203.0.113.5:30120"), use that address instead of 127.0.0.1.
  • Replace fxv_... with your key. Use set, never setr or sets, which send the value to players or to the server list.
  • Without loki:tenant, logs go to the key's dataset, else to default.
  • Restart the resources that log after changing these lines. fxvault status in the server console then shows what came through.
  • fxvault takes these posts only from the server itself and only with the loki:user and loki:key set on it. It needs no fxvault:key of its own.

Without the fxvault resource

ox_lib can also send straight to fxvault Logs. Use the lines above with this endpoint:

Config
set loki:endpoint "logs.fxvault.link"

ox_lib then sends each batch once. When the network is slow for a moment, FiveM gives up after 5 seconds, that batch is lost, and the console prints unable to submit logs to https://logs.fxvault.link/loki/api/v1/push (status: 0).

With the Datadog provider

For servers already on ox_lib's Datadog provider:

Config
set ox:logger "datadog"
set datadog:site "fxvault.link"
set datadog:key "fxv_..."

Use fxvault.link exactly. ox_lib builds the address from it, and text after it, such as a path, gets a not found answer that ox_lib prints as a console warning. ox_lib sends no dataset with this provider, so logs go to the key's dataset (pick one when you create the key), else to default.

Request rate

Through the fxvault resource, one sender batches the lines of every resource, so the request limit rarely matters.

Sent straight to fxvault Logs, each resource that logs sends a request about every half second. One key takes 100 requests per 10 seconds on Free, 200 on Starter, 500 on Pro and 1,000 on Network. That is about 5 resources logging nonstop on Free and 25 on Pro.

Check it

Send one log, or move an item in game. The Setup page turns green when a new log arrives, and it shows on the Logs tab.

Source: ox_lib's Loki provider and Datadog provider.

Need a server, or a hand with one?

Pick a plan to deploy a server, or open a ticket in the panel. Support runs 24/7/365.