From 1e7c80ca9f5ffab420989ec229d973958f979675 Mon Sep 17 00:00:00 2001 From: jeffusion Date: Thu, 26 Mar 2026 23:14:04 +0800 Subject: [PATCH] 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) --- README.md | 1 + docs/configuration.md | 1 + docs/configuration.zh-CN.md | 1 + docs/deployment.md | 5 ++++- docs/deployment.zh-CN.md | 5 ++++- docs/getting-started.md | 1 + docs/getting-started.zh-CN.md | 1 + 7 files changed, 13 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index c40ed38..40ad546 100644 --- a/README.md +++ b/README.md @@ -63,6 +63,7 @@ bun run bootstrap PORT=5174 ENCRYPTION_KEY= # required, 64 hex chars (openssl rand -hex 32) # 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. diff --git a/docs/configuration.md b/docs/configuration.md index b9a0f45..b9f7200 100644 --- a/docs/configuration.md +++ b/docs/configuration.md @@ -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 | - | | `PORT` | No | Service port | `5174` | | `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: diff --git a/docs/configuration.zh-CN.md b/docs/configuration.zh-CN.md index b655d08..6405721 100644 --- a/docs/configuration.zh-CN.md +++ b/docs/configuration.zh-CN.md @@ -14,6 +14,7 @@ | `ENCRYPTION_KEY` | 是 | API Key 加密主密钥(AES-256-GCM,64 位十六进制) | - | | `PORT` | 否 | 服务端口 | `5174` | | `DATABASE_PATH` | 否 | SQLite 路径 | `./data/assistant.db` | +| `LOG_LEVEL` | 否 | 后端日志级别(`debug`/`info`/`warn`/`error`)。默认 `info`;生产环境建议 `error`。 | `info` | 生成密钥: diff --git a/docs/deployment.md b/docs/deployment.md index c81f851..c30deb6 100644 --- a/docs/deployment.md +++ b/docs/deployment.md @@ -4,7 +4,7 @@ ```bash 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 @@ -18,11 +18,14 @@ docker compose up -d - `gitea-assistant` - `qdrant` +Production default in compose sets `LOG_LEVEL=error`. + If you do not use memory features, Qdrant can be optional in custom compose setups. ## Kubernetes Kubernetes manifests are in `k8s/`. +The default ConfigMap sets `LOG_LEVEL=error` for production. ### 1) Create namespace and encryption secret diff --git a/docs/deployment.zh-CN.md b/docs/deployment.zh-CN.md index 955dc10..1fefe04 100644 --- a/docs/deployment.zh-CN.md +++ b/docs/deployment.zh-CN.md @@ -4,7 +4,7 @@ ```bash 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 @@ -18,11 +18,14 @@ docker compose up -d - `gitea-assistant` - `qdrant` +Compose 生产默认日志级别已设置为 `LOG_LEVEL=error`。 + 如果不使用记忆能力,可在自定义编排中将 Qdrant 设为可选。 ## Kubernetes Kubernetes 清单位于 `k8s/` 目录。 +默认 ConfigMap 已将生产日志级别设置为 `LOG_LEVEL=error`。 ### 1) 创建命名空间与加密密钥 diff --git a/docs/getting-started.md b/docs/getting-started.md index 33dc13b..f69d9d0 100644 --- a/docs/getting-started.md +++ b/docs/getting-started.md @@ -30,6 +30,7 @@ Create `.env`: PORT=5174 ENCRYPTION_KEY= # required, generate with: openssl rand -hex 32 # 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. diff --git a/docs/getting-started.zh-CN.md b/docs/getting-started.zh-CN.md index 7f982d6..5c6a608 100644 --- a/docs/getting-started.zh-CN.md +++ b/docs/getting-started.zh-CN.md @@ -30,6 +30,7 @@ bun run bootstrap PORT=5174 ENCRYPTION_KEY= # 必填,使用 openssl rand -hex 32 生成 # DATABASE_PATH=./data/assistant.db +# LOG_LEVEL=info # 本地开发默认;生产环境请使用 LOG_LEVEL=error ``` > `ENCRYPTION_KEY` 为必填项,缺失时服务会拒绝启动。