> For the complete documentation index, see [llms.txt](https://laot7490.gitbook.io/ltbridge/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://laot7490.gitbook.io/ltbridge/utilities/logger/init.md).

# Init

Initialize the logger. Must be called once before `LT.Logger.Create`.

{% hint style="info" %}
**Side:** Server · **Category:** Logger · **API:** `LT.Logger.Init`
{% endhint %}

{% hint style="warning" %}
`fivemanage` requires the `fmsdk` resource to be running.
{% endhint %}

## Example

```lua
LT.Logger.Init('discord', {
    webhook = '', -- Webhook URL if using discord.
    folder = 'custom_logs_folder', -- Custom folder if using txt logs. Must be manually created in resource directory.
    fivemerrAPIKey = '', -- Fivemerr API key if using it.
    interval = 60000, -- Log write/send interval to prevent spam or rate limits. (default: 60000 -> every minute)
})
```

## Parameters

| Name      | Required | Description                                                                                                                                                                |
| --------- | -------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `logType` | Yes      | 'discord'                                                                                                                                                                  |
| `data`    | No       | { `webhook: string` (If using discord), `folder: string` (If using txt, optional), `interval: number` (optional), `fivemerrAPIKey: string` (If using fivemerr, optional) } |
