This is an automated email from the ASF dual-hosted git repository.
lizhimin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/rocketmq-client-cpp.git
The following commit(s) were added to refs/heads/master by this push:
new 965fed3 [ISSUE #499] Fix log sharding bug (#500)
965fed3 is described below
commit 965fed3cb5f491529b00471b35c2ceeadb5c229f
Author: takagi <[email protected]>
AuthorDate: Tue Mar 17 10:03:43 2026 +0800
[ISSUE #499] Fix log sharding bug (#500)
Co-authored-by: weilin <[email protected]>
---
src/log/Logging.cpp | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/log/Logging.cpp b/src/log/Logging.cpp
index 34ab25f..ea38fb0 100644
--- a/src/log/Logging.cpp
+++ b/src/log/Logging.cpp
@@ -119,6 +119,7 @@ void logAdapter::setLogDir() {
void logAdapter::setLogFileNumAndSize(int logNum, int sizeOfPerFile) {
string homeDir(UtilAll::getHomeDirectory());
homeDir.append(m_log_dir);
+ m_logSink->locked_backend()->set_rotation_size(sizeOfPerFile * 1024 * 1024);
m_logSink->locked_backend()->set_file_collector(sinks::file::make_collector(
keywords::target = homeDir, keywords::max_size = logNum * sizeOfPerFile
* 1024 * 1024));
}