cjphaha opened a new pull request #1335:
URL: https://github.com/apache/dubbo-go/pull/1335


   修改 common/logger,添加 lumberjack 设置。
   
   增加如下功能:
   1. 控制每个日志文件的大小
   2. 控制最多保留的日志文件及保留最近多少天的日志文件
   3. dubbo-go logger 原有特性仍然被保留
   
   使用方法:在原有的日志配置文件中添加 lumberjackConfig 配置项,原有的配置放到 zapConfig 配置项中(可以参考 
`common/logger/file_log.yml`), lumberjackConfig 配置方法如下:
   ```yaml
   lumberjackConfig:
     # 写日志的文件名称
     filename: "logs.log"
     # 每个日志文件长度的最大大小,默认100M
     maxSize: 1
     # 日志保留的最大天数(只保留最近多少天的日志)
     maxAge: 3
     # 只保留最近多少个日志文件,用于控制程序总日志的大小
     maxBackups: 5
     # 是否使用本地时间,默认使用UTC时间
     localTime: true
     # 是否压缩日志文件,压缩方法gzip
     compress: false
   ```


-- 
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