This commit is contained in:
aruo
2026-05-31 21:45:14 +08:00
parent d4b5015beb
commit ac08345369
67 changed files with 11120 additions and 387 deletions
+76
View File
@@ -0,0 +1,76 @@
@echo off
chcp 65001 > nul
REM 日志配置验证脚本 (Windows)
echo ======================================
echo 日志配置验证
echo ======================================
echo.
REM 1. 检查日志目录
echo [1/5] 检查日志目录...
if exist "logs\" (
echo ✅ logs\ 目录已存在
dir logs\ 2>nul || echo 目录为空(项目未启动)
) else (
echo ⚠️ logs\ 目录不存在(项目启动后会自动创建)
)
echo.
REM 2. 检查配置文件
echo [2/5] 检查配置文件...
if exist "src\main\resources\logback-spring.xml" (
echo ✅ logback-spring.xml 已存在
) else (
echo ❌ logback-spring.xml 缺失
)
findstr /C:"logging:" src\main\resources\application.yml > nul
if %errorlevel% equ 0 (
echo ✅ application.yml 包含 logging 配置
) else (
echo ⚠️ application.yml 没有 logging 配置(使用 logback-spring.xml)
)
echo.
REM 3. 检查 .gitignore
echo [3/5] 检查 .gitignore...
findstr /C:"logs/" .gitignore > nul
if %errorlevel% equ 0 (
echo ✅ logs/ 已在 .gitignore 中
) else (
echo ⚠️ logs/ 未在 .gitignore 中(建议添加)
)
echo.
REM 4. 检查 Maven
echo [4/5] 检查 Maven...
where mvn > nul 2>&1
if %errorlevel% equ 0 (
echo ✅ Maven 已安装
mvn --version | findstr "Apache Maven"
) else (
echo ⚠️ Maven 未安装或未在 PATH 中
)
echo.
REM 5. 下一步提示
echo [5/5] 下一步操作:
echo.
echo 1. 启动项目:
echo mvn spring-boot:run
echo.
echo 2. 等待启动完成后,查看日志文件:
echo dir logs\
echo.
echo 3. 实时查看日志(PowerShell):
echo Get-Content logs\application.log -Wait -Tail 50
echo.
echo 4. 在 Claude Code 中分析日志:
echo ! tail -n 100 logs/application.log
echo 或使用 Read 工具: Read logs/application.log
echo.
echo ======================================
echo 验证完成!
echo ======================================
pause