mirror of
https://github.com/darksaid98/overextended.github.io.git
synced 2026-12-01 14:38:50 +00:00
36 lines
1.2 KiB
Markdown
36 lines
1.2 KiB
Markdown
# Logger
|
|
|
|
Submit logs to Datadog.
|
|
|
|
Register an account with [datadog](https://www.datadoghq.com/). Once registered you need to create an [API key](https://app.datadoghq.com/organization-settings/api-keys).
|
|
Modify your `server.cfg` with the newly generated API key and [intake server](https://docs.datadoghq.com/api/latest/logs/#send-logs).
|
|
- datadoghq.com
|
|
- us3.datadoghq.com
|
|
- us5.datadoghq.com
|
|
- datadoghq.eu
|
|
```
|
|
set datadog:key "yourapikey"
|
|
set datadog:site "datadoghq.com"
|
|
```
|
|
|
|
```lua
|
|
-- source: string | number
|
|
-- event: string
|
|
-- message: string
|
|
-- ...: string
|
|
lib.logger(source, event, message, ...)
|
|
```
|
|
|
|
Source is passed to ddsource and creates a tag. Could be playerId, identifier, -1, or server.
|
|
Event is passed to ddservice and displays in the logs list.
|
|
Additional arguments are converted into tags for additional filtering and search options.
|
|
|
|
```lua
|
|
local vehicle = Ox.CreateVehicle(false, `sultanrs`, vec(-56.479122, -1116.870362, 26.432250, 0.000030517578))
|
|
lib.logger(-1, 'CreateVehicle', json.encode(vehicle))
|
|
```
|
|
|
|

|
|
|
|

|