docs: document LOG_LEVEL configuration and production defaults

Update all documentation to reflect new global LOG_LEVEL environment variable.

- Add LOG_LEVEL to configuration reference tables

- Update deployment guides with LOG_LEVEL=error examples

- Clarify dev (info) vs production (error) log level recommendations

- Add LOG_LEVEL to all .env examples and quick start guides

Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-openagent)
This commit is contained in:
jeffusion
2026-03-26 23:14:04 +08:00
committed by 路遥知码力
parent b92765ce7f
commit 1e7c80ca9f
7 changed files with 13 additions and 2 deletions

View File

@@ -63,6 +63,7 @@ bun run bootstrap
PORT=5174 PORT=5174
ENCRYPTION_KEY= # required, 64 hex chars (openssl rand -hex 32) ENCRYPTION_KEY= # required, 64 hex chars (openssl rand -hex 32)
# DATABASE_PATH=./data/assistant.db # DATABASE_PATH=./data/assistant.db
# LOG_LEVEL=info # dev default; use LOG_LEVEL=error in production
``` ```
> `ENCRYPTION_KEY` is mandatory. The app refuses to start without it. > `ENCRYPTION_KEY` is mandatory. The app refuses to start without it.

View File

@@ -14,6 +14,7 @@ This project uses a DB-first runtime configuration model:
| `ENCRYPTION_KEY` | Yes | AES-256-GCM master key (64 hex chars) for API key encryption | - | | `ENCRYPTION_KEY` | Yes | AES-256-GCM master key (64 hex chars) for API key encryption | - |
| `PORT` | No | Service port | `5174` | | `PORT` | No | Service port | `5174` |
| `DATABASE_PATH` | No | SQLite path | `./data/assistant.db` | | `DATABASE_PATH` | No | SQLite path | `./data/assistant.db` |
| `LOG_LEVEL` | No | Backend log level (`debug`/`info`/`warn`/`error`). Default is `info`; use `error` in production. | `info` |
Generate key: Generate key:

View File

@@ -14,6 +14,7 @@
| `ENCRYPTION_KEY` | 是 | API Key 加密主密钥AES-256-GCM64 位十六进制) | - | | `ENCRYPTION_KEY` | 是 | API Key 加密主密钥AES-256-GCM64 位十六进制) | - |
| `PORT` | 否 | 服务端口 | `5174` | | `PORT` | 否 | 服务端口 | `5174` |
| `DATABASE_PATH` | 否 | SQLite 路径 | `./data/assistant.db` | | `DATABASE_PATH` | 否 | SQLite 路径 | `./data/assistant.db` |
| `LOG_LEVEL` | 否 | 后端日志级别(`debug`/`info`/`warn`/`error`)。默认 `info`;生产环境建议 `error`。 | `info` |
生成密钥: 生成密钥:

View File

@@ -4,7 +4,7 @@
```bash ```bash
docker build -t gitea-assistant . docker build -t gitea-assistant .
docker run -d -p 5174:5174 -v ./data:/app/data -e PORT=5174 gitea-assistant docker run -d -p 5174:5174 -v ./data:/app/data -e PORT=5174 -e LOG_LEVEL=error gitea-assistant
``` ```
## Docker Compose ## Docker Compose
@@ -18,11 +18,14 @@ docker compose up -d
- `gitea-assistant` - `gitea-assistant`
- `qdrant` - `qdrant`
Production default in compose sets `LOG_LEVEL=error`.
If you do not use memory features, Qdrant can be optional in custom compose setups. If you do not use memory features, Qdrant can be optional in custom compose setups.
## Kubernetes ## Kubernetes
Kubernetes manifests are in `k8s/`. Kubernetes manifests are in `k8s/`.
The default ConfigMap sets `LOG_LEVEL=error` for production.
### 1) Create namespace and encryption secret ### 1) Create namespace and encryption secret

View File

@@ -4,7 +4,7 @@
```bash ```bash
docker build -t gitea-assistant . docker build -t gitea-assistant .
docker run -d -p 5174:5174 -v ./data:/app/data -e PORT=5174 gitea-assistant docker run -d -p 5174:5174 -v ./data:/app/data -e PORT=5174 -e LOG_LEVEL=error gitea-assistant
``` ```
## Docker Compose ## Docker Compose
@@ -18,11 +18,14 @@ docker compose up -d
- `gitea-assistant` - `gitea-assistant`
- `qdrant` - `qdrant`
Compose 生产默认日志级别已设置为 `LOG_LEVEL=error`
如果不使用记忆能力,可在自定义编排中将 Qdrant 设为可选。 如果不使用记忆能力,可在自定义编排中将 Qdrant 设为可选。
## Kubernetes ## Kubernetes
Kubernetes 清单位于 `k8s/` 目录。 Kubernetes 清单位于 `k8s/` 目录。
默认 ConfigMap 已将生产日志级别设置为 `LOG_LEVEL=error`
### 1) 创建命名空间与加密密钥 ### 1) 创建命名空间与加密密钥

View File

@@ -30,6 +30,7 @@ Create `.env`:
PORT=5174 PORT=5174
ENCRYPTION_KEY= # required, generate with: openssl rand -hex 32 ENCRYPTION_KEY= # required, generate with: openssl rand -hex 32
# DATABASE_PATH=./data/assistant.db # DATABASE_PATH=./data/assistant.db
# LOG_LEVEL=info # local dev default; use LOG_LEVEL=error in production
``` ```
> `ENCRYPTION_KEY` is required. Application startup fails when it is missing. > `ENCRYPTION_KEY` is required. Application startup fails when it is missing.

View File

@@ -30,6 +30,7 @@ bun run bootstrap
PORT=5174 PORT=5174
ENCRYPTION_KEY= # 必填,使用 openssl rand -hex 32 生成 ENCRYPTION_KEY= # 必填,使用 openssl rand -hex 32 生成
# DATABASE_PATH=./data/assistant.db # DATABASE_PATH=./data/assistant.db
# LOG_LEVEL=info # 本地开发默认;生产环境请使用 LOG_LEVEL=error
``` ```
> `ENCRYPTION_KEY` 为必填项,缺失时服务会拒绝启动。 > `ENCRYPTION_KEY` 为必填项,缺失时服务会拒绝启动。