Files
ai-team-dashboard/dashboard/LOGGING_CONFIG_QUICK.md
fang 5f14174bb9 feat: 添加 Dashboard 完整日志监控系统 v1.1.0
 新增功能
- 完整的日志记录系统(6 种日志级别)
- 日志配置功能(可通过 config.json 控制)
- 性能监控装饰器和请求日志中间件
- 7 个管理工具脚本
- 完整的文档和使用指南

🛠️ 管理工具
- start-with-log.sh: 启动脚本(带日志)
- stop-dashboard.sh: 停止脚本
- view-logs.sh: 日志查看器
- monitor-logs.sh: 实时监控工具(支持多种过滤器)
- analyze-logs.sh: 日志分析工具(自动生成报告)
- demo-logging.sh: 功能演示脚本
- test-logging-config.sh: 配置测试工具

📊 日志特性
- 支持 INFO/SUCCESS/WARN/ERROR/DEBUG/PERF 6 种级别
- 自动记录启动过程、API 请求、性能统计
- 缓存命中情况追踪
- 分步性能监控
- 智能过滤器

⚙️ 配置功能
- 可控制是否启用日志(默认:true)
- 可设置日志级别(默认:INFO)
- 可控制文件/控制台输出
- 支持动态配置(重启生效)

📚 文档
- LOGGING_GUIDE.md: 完整使用指南
- LOGGING_CONFIG.md: 配置说明文档
- LOGGING_CONFIG_QUICK.md: 快速配置指南
- 多个中文说明文档

🔒 安全
- 添加 .gitignore 排除敏感信息
- config.json(含 Token)不提交
- 日志文件不提交
- 示例配置使用占位符

 测试
- 语法检查通过
- 功能完整性验证
- 配置控制测试通过
- 文档完整性检查

详见 CHANGELOG_v1.1.0.md

Made-with: Cursor
2026-03-11 11:37:35 +08:00

117 lines
2.0 KiB
Markdown
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Dashboard 日志配置 - 快速指南
## 🚀 5 分钟配置指南
### 1⃣ 打开配置文件
```bash
cd /Users/fang/Desktop/ai-team/dashboard
vim config.json
```
### 2⃣ 添加日志配置
`dashboard` 部分添加 `logging` 配置:
```json
{
"dashboard": {
"port": 3800,
"logging": {
"enabled": true,
"level": "INFO",
"file": true,
"console": true
}
}
}
```
### 3⃣ 重启 Dashboard
```bash
./stop-dashboard.sh
./start-with-log.sh
```
### 4⃣ 验证配置
```bash
tail -20 logs/dashboard.log | grep "日志配置"
```
应该看到:
```
[时间] [INFO] [配置] 日志配置已更新 | {"enabled":true,"level":"INFO",...}
```
## ⚙️ 常用配置
### 场景 1开发调试看所有详细日志
```json
"logging": {
"enabled": true,
"level": "DEBUG",
"file": true,
"console": true
}
```
### 场景 2生产环境推荐
```json
"logging": {
"enabled": true,
"level": "INFO",
"file": true,
"console": false
}
```
### 场景 3只看错误
```json
"logging": {
"enabled": true,
"level": "ERROR",
"file": true,
"console": true
}
```
### 场景 4关闭日志不推荐
```json
"logging": {
"enabled": false,
"level": "INFO",
"file": false,
"console": false
}
```
## 📊 配置说明
| 配置项 | 值 | 说明 |
|--------|-------|------|
| `enabled` | `true` / `false` | 是否启用日志 |
| `level` | `"DEBUG"` | 最详细,所有调试信息 |
| | `"INFO"` | 一般信息(推荐)⭐ |
| | `"WARN"` | 只记录警告和错误 |
| | `"ERROR"` | 只记录错误 |
| `file` | `true` / `false` | 是否写入日志文件 |
| `console` | `true` / `false` | 是否输出到控制台 |
## 🎯 推荐配置
**默认配置(已配置好):**
- ✅ 日志已启用
- ✅ INFO 级别
- ✅ 写入文件
- ✅ 输出控制台
**无需修改即可使用!**
## 📚 更多信息
- 完整配置说明:`cat LOGGING_CONFIG.md`
- 使用指南:`cat LOGGING_GUIDE.md`
- 测试配置:`./test-logging-config.sh`