Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 40 additions & 1 deletion content/en/hosting/cht/docker/logs.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,46 @@ CHT has the following services running via Docker and each can have its logs que

## Setting log level

By default, the CHT server logs are set to the `info` level. To change the log level to `debug`, you can set the `NODE_ENV` environment variable to `development`. A log level of `debug` can affect system performance and cause log files sizes to grow rapidly. It is recommended to temporarily set the log level to `debug` only when needed for troubleshooting.
To control log verbosity, set the `LOG_LEVEL` environment variable for the `api` and `sentinel` containers. The default value is `info`.

{{< callout type="info" >}}
From version 5.1.0 onward, use `LOG_LEVEL` to control log verbosity. The `NODE_ENV` value no longer affects logging detail.
{{< /callout >}}

### Configuration

Add `LOG_LEVEL` to the `.env` file used by your Docker Compose deployment:

```
LOG_LEVEL=debug
```

Then start or recreate the containers:
```bash
docker compose up -d
```

**Supported values:**

- `error` — Only error messages
- `warn` — Warnings and errors
- `info` — General information (default, recommended for production)
- `debug` — Detailed diagnostic information (troubleshooting only)

{{< callout type="warning" >}}
Using `debug` level generates significantly more logs and may impact performance. Use it only for troubleshooting and switch back to `info` or `warn` for normal operations.
{{< /callout >}}

### Applying changes to running containers

To change the log level for already running containers, update the `LOG_LEVEL` value in your `.env` file and recreate the containers:
```bash
docker compose up -d
```

{{< callout type="info" >}}
`docker compose restart` does not pick up environment variable changes. Use `docker compose up -d` to recreate the containers with the new configuration.
{{< /callout >}}

## Viewing logs

Expand Down
Loading