Snow-kal opened a new pull request, #1105:
URL: https://github.com/apache/dubbo-go-samples/pull/1105

   ## 变更内容
   
   修复 `logger/rolling` 样例运行后未生成 `logs.log` 的问题。
   
   主要修改:
   
   - 在 `logger/rolling/conf/dubbogo.yml` 中增加 `appender: file`
     - dubbo-go logger 默认 `appender` 是 `console`
     - 仅配置 `logger.file` 不会自动启用文件输出
     - 显式设置 `appender: file` 后,日志会写入 `logs.log`
   
   - 调整 `logger/rolling/cmd/main.go` 的日志输出频率
     - 每轮日志输出后增加 `time.Sleep(time.Second * 1)`
     - 与其他 logger 样例保持一致
     - 避免 3 秒内过快刷日志导致样例行为不直观
   
   - 更新 `logger/README.md` 和 `logger/README_zh.md`
     - 说明文件输出需要配置 `appender: file`
     - 说明从 `logger/rolling` 目录运行时,`logs.log` 会生成在 `logger/rolling/logs.log`
     - 补充如需同时输出控制台和文件,可使用 `appender: console,file`
   
   ## 验证方式
   
   在 PowerShell 中执行:
   
   ```powershell
   cd logger/rolling
   $env:DUBBO_GO_CONFIG_PATH = "./conf/dubbogo.yml"
   go run ./cmd/main.go
   Get-ChildItem .\logs.log
   Get-Content .\logs.log -Tail 20
   ```
   
   
   <img width="1226" height="725" alt="image" 
src="https://github.com/user-attachments/assets/343bd586-9cd0-4681-a301-6b9b9a7d6c46";
 />
   
   
   
   
   issue https://github.com/apache/dubbo-go-samples/issues/1075


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to