mirror of
https://github.com/darksaid98/overextended.github.io.git
synced 2026-12-01 14:38:50 +00:00
* refactor: Add h1 headers to all pages missing it * refactor: missed example h3 * change hooks example heading to bold text --------- Co-authored-by: Luke <[email protected]>
87 lines
2.8 KiB
Plaintext
87 lines
2.8 KiB
Plaintext
import { Steps, Tabs, Tab } from 'nextra-theme-docs';
|
|
|
|
# Server
|
|
|
|
## lib.logger
|
|
|
|
```lua
|
|
lib.logger(source, event, message, ...)
|
|
```
|
|
|
|
- source: `number` or `string`
|
|
- Preferably an active player id, otherwise an identifier, or wherever else it originated from.
|
|
- event: `string`
|
|
- A name for the log event (i.e. the trigerring event or a description)
|
|
- message: `string`
|
|
- The content for the log.
|
|
- vararg: `string`
|
|
- Additional arguments are converted to tags for additional filtering and searching.
|
|
|
|
### Example
|
|
|
|
```lua
|
|
local vehicle = Ox.CreateVehicle(false, `sultanrs`, vector4(-56.479122, -1116.870362, 26.432250, 0.000030517578))
|
|
lib.logger(-1, 'CreateVehicle', json.encode(vehicle))
|
|
```
|
|
|
|
## Datadog
|
|
|
|
<Steps>
|
|
### Create your [Datadog](https://www.datadoghq.com/) account
|
|
You will receive a free 14 day trial, otherwise refer to their [pricing](https://www.datadoghq.com/pricing/) guide.
|
|
Free accounts are limited, however logs will still be retained for 14 days.
|
|
|
|
### Create an [API key](https://app.datadoghq.com/organization-settings/api-keys)
|
|
|
|
This is a UUID used to submit logs to your Datadog organisation.
|
|
|
|
### Config
|
|
|
|
Set your API key and [Datadog site](https://docs.datadoghq.com/getting_started/site/) using the following convars.
|
|
|
|
```bash
|
|
set datadog:key "yourapikey"
|
|
set datadog:site "datadoghq.com"
|
|
```
|
|
</Steps>
|
|
|
|
## Grafana Loki
|
|
|
|
Loki is a horizontally scalable, highly available, multi-tenant log aggregation system inspired by Prometheus.
|
|
It is designed to be very cost effective and easy to operate.
|
|
|
|
<Tabs items={["Cloud", "Self-hosted"]}>
|
|
<Tab>
|
|
- Has free tier with some restrictions
|
|
- Easy to manage
|
|
- Easier to setup
|
|
- Mostly managed by Grafana
|
|
|
|
<Steps>
|
|
### Create your [Grafana](https://grafana.com/) account
|
|
### Head to [My Account](https://grafana.com/auth/sign-in/?plcmt=top-nav&cta=myaccount)
|
|
### Setup Loki
|
|
Find the Loki section in your account panel, and click "Details".
|
|
Generate a password and save the API key, as well as your `user` and `url`.
|
|
</Steps>
|
|
</Tab>
|
|
<Tab>
|
|
To setup a grafana instance you'll need docker, and knowledge on containers or kubernetes.
|
|
Please find a guide to setup a grafana stack (min requirement grafana and grafana loki) and follow that.
|
|
|
|
Once done, setup authentication and use the username and password securing your endpoint.
|
|
|
|
- By default self-hosted loki instances do not provide any authentication layers and will require an external authentication layer such as NGINX basic auth or Cloudflare Access.
|
|
</Tab>
|
|
</Tabs>
|
|
|
|
### Config
|
|
Use the following convars to set your logging service, endpoint, and authentication details.
|
|
|
|
```bash
|
|
set ox:logger "loki"
|
|
set loki:user "<insert your user>"
|
|
set loki:password "<insert the api key or password>"
|
|
set loki:endpoint "<insert loki url without http:// or https://>"
|
|
```
|