> ## Documentation Index
> Fetch the complete documentation index at: https://lightdash-refactor-full-audit-reorg.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Configure logging for Lightdash

<Note>
  🛠 This page is for engineering teams self-hosting their own Lightdash instance. If you want to monitor usage and analytics, go to the [Usage analytics](/workspace-admin/usage-analytics) guide.
</Note>

By default Lightdash logs to the console in a human readable format. You can configure the logging behaviour, such as logging to a file or using a JSON format, by using the following environment variables:

| Variable                              | Description                                                                                                                                                                                                                             |
| :------------------------------------ | :-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `LIGHTDASH_LOG_LEVEL`                 | The minimum level of log messages to show. `DEBUG`, `AUDIT`, `HTTP`, `INFO`, `WARN` `ERROR` (default=INFO)                                                                                                                              |
| `LIGHTDASH_LOG_FORMAT`                | The format of log messages. `PLAIN`, `PRETTY`, `JSON` (default=pretty)                                                                                                                                                                  |
| `LIGHTDASH_LOG_OUTPUTS`               | The outputs to send log messages to (default=console)                                                                                                                                                                                   |
| `LIGHTDASH_LOG_CONSOLE_LEVEL`         | The minimum level of log messages to display on the console (default=LIGHTDASH\_LOG\_LEVEL)                                                                                                                                             |
| `LIGHTDASH_LOG_CONSOLE_FORMAT`        | The format of log messages on the console (default=LIGHTDASH\_LOG\_FORMAT)                                                                                                                                                              |
| `LIGHTDASH_LOG_FILE_LEVEL`            | The minimum level of log messages to write to the log file (default=LIGHTDASH\_LOG\_LEVEL)                                                                                                                                              |
| `LIGHTDASH_LOG_FILE_FORMAT`           | The format of log messages in the log file (default=LIGHTDASH\_LOG\_FORMAT)                                                                                                                                                             |
| `LIGHTDASH_LOG_FILE_PATH`             | The path to the log file. Requires `LIGHTDASH_LOG_OUTPUTS` to include `file` to enable file output. (default=./logs/all.log)                                                                                                            |
| `LIGHTDASH_LOG_AUDIT_ACTOR_AS_STRING` | When `true`, audit log events serialize the `actor` field to a JSON string instead of a nested object. Enable this if your log indexer (e.g. Elasticsearch) maps the `actor` field as text and would otherwise drop it. (default=false) |
