You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@rocketmq.apache.org by ji...@apache.org on 2026/05/07 03:46:47 UTC

(rocketmq-clients) branch master updated: fix(log.go): adjust log file size unit and enable local time (#1238)

This is an automated email from the ASF dual-hosted git repository.

RongtongJin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/rocketmq-clients.git


The following commit(s) were added to refs/heads/master by this push:
     new a5b541c2 fix(log.go): adjust log file size unit and enable local time (#1238)
a5b541c2 is described below

commit a5b541c2bb392756b4b223058b1a8eec5e4179b3
Author: Quan <zs...@foxmail.com>
AuthorDate: Thu May 7 11:46:41 2026 +0800

    fix(log.go): adjust log file size unit and enable local time (#1238)
    
    Change the default log file max size from bytes (1073741824) to MB (100), and enable local time recording (default is UTC) to improve log configuration readability and usability.
---
 golang/log.go | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/golang/log.go b/golang/log.go
index c6a4cf43..a2b3d2bb 100644
--- a/golang/log.go
+++ b/golang/log.go
@@ -87,7 +87,7 @@ func getLogWriter() zapcore.WriteSyncer {
 	clientLogRoot := utils.GetenvWithDef(CLIENT_LOG_ROOT, homeDir+"/logs/rocketmq")
 	clientLogMaxIndex := utils.GetenvWithDef(CLIENT_LOG_MAXINDEX, "10")
 	clientLogFileName := utils.GetenvWithDef(CLIENT_LOG_FILENAME, "rocketmq_client_go.log")
-	clientLogMaxFileSize := utils.GetenvWithDef(CLIENT_LOG_FILESIZE, "1073741824")
+	clientLogMaxFileSize := utils.GetenvWithDef(CLIENT_LOG_FILESIZE, "100") // unit: MB
 
 	logFileName := clientLogRoot + "/" + clientLogFileName
 	maxFileIndex, err := strconv.Atoi(clientLogMaxIndex)
@@ -104,6 +104,7 @@ func getLogWriter() zapcore.WriteSyncer {
 		Filename:   logFileName,
 		MaxSize:    maxFileSize,
 		MaxBackups: maxFileIndex,
+		LocalTime:  true, // use local time, default is UTC
 		Compress:   false,
 	}
 	return zapcore.AddSync(lumberJackLogger)