> ## Documentation Index
> Fetch the complete documentation index at: https://docs.fivemanage.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Configuration

> Configure your logging providers and event tracking.

The Fivemanage Logger is configured using a `config.json` file located in `mods/Fivemanage_Logger/config.json`.

## Configuration Structure

The configuration is divided into two main sections: `LogProvider` and `PlayerEvents`.

```json theme={null}
{
  "LogProvider": {
    "Provider": "fivemanage",
    "ApiKey": "your-fivemanage-api-key",
    "WriteToDisk": false,
    "EnableBatching": true,
    "BufferSize": 10,
    "FlushIntervalMs": 5000
  },
  "PlayerEvents": {
    "Dataset": "player-events",
    "Enabled": true
  }
}
```

## Log Provider Options

| Option            | Type      | Description                                                                  |
| :---------------- | :-------- | :--------------------------------------------------------------------------- |
| `Provider`        | `string`  | The logging backend to use: `fivemanage`, `grafana-loki`, or `file`.         |
| `ApiKey`          | `string`  | Your Fivemanage API key (required for `fivemanage` provider).                |
| `Endpoint`        | `string`  | The Loki push endpoint URL (required for `grafana-loki`).                    |
| `Username`        | `string`  | Basic auth username for Grafana Loki.                                        |
| `Password`        | `string`  | Basic auth password/API key for Grafana Loki.                                |
| `WriteToDisk`     | `boolean` | If `true`, logs will also be written to local files in the `logs` directory. |
| `EnableBatching`  | `boolean` | Whether to buffer logs before sending them to the provider.                  |
| `BufferSize`      | `integer` | Number of logs to buffer before flushing (default: `10`).                    |
| `FlushIntervalMs` | `integer` | Maximum time (in ms) to wait before flushing the buffer (default: `5000`).   |

## Provider Specifics

### Fivemanage Cloud

To use Fivemanage Cloud, set the provider to `fivemanage` and provide your API key.

```json theme={null}
"LogProvider": {
  "Provider": "fivemanage",
  "ApiKey": "YOUR_API_KEY"
}
```

### Grafana Loki

To send logs to Grafana Loki or Grafana Cloud, use the `grafana-loki` provider.

```json theme={null}
"LogProvider": {
  "Provider": "grafana-loki",
  "Endpoint": "https://logs-prod-us-central1.grafana.net/loki/api/v1/push",
  "Username": "123456",
  "Password": "your-grafana-api-key"
}
```

## Player Events Options

| Option    | Type      | Description                                                                                |
| :-------- | :-------- | :----------------------------------------------------------------------------------------- |
| `Dataset` | `string`  | The name of the dataset (or label) where player events will be stored.                     |
| `Enabled` | `boolean` | If `true`, the plugin will automatically log player connect, ready, and disconnect events. |

### Automatically Tracked Events

When `PlayerEvents.Enabled` is set to `true`, the following events are captured:

* **Player Connect:** Logged when a player initiates a connection.
* **Player Ready:** Logged when a player has fully loaded into the world.
* **Player Disconnect:** Logged when a player leaves the server.
