You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by "Snow-kal (via GitHub)" <gi...@apache.org> on 2026/05/10 12:03:40 UTC

[PR] Fix/rolling logger [dubbo-go-samples]

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

   ## 变更内容
   
   修复 `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: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


Re: [PR] Fix/rolling logger [dubbo-go-samples]

Posted by "Snow-kal (via GitHub)" <gi...@apache.org>.
Snow-kal commented on PR #1104:
URL: https://github.com/apache/dubbo-go-samples/pull/1104#issuecomment-4415252878

   我的问题  没有细看 samples 的 develop 分支目前是不用了


-- 
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: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


Re: [PR] Fix/rolling logger [dubbo-go-samples]

Posted by "Snow-kal (via GitHub)" <gi...@apache.org>.
Snow-kal closed pull request #1104: Fix/rolling logger
URL: https://github.com/apache/dubbo-go-samples/pull/1104


-- 
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: notifications-unsubscribe@dubbo.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org