ifplusor commented on a change in pull request #401:
URL:
https://github.com/apache/rocketmq-client-cpp/pull/401#discussion_r801260358
##########
File path: src/log/Logging.cpp
##########
@@ -38,16 +38,19 @@ logAdapter* logAdapter::getLogInstance() {
}
logAdapter::logAdapter() : m_logLevel(eLOG_LEVEL_INFO) {
+ setLogDir();
string homeDir(UtilAll::getHomeDirectory());
- homeDir.append("/logs/rocketmq-cpp/");
+ homeDir.append(m_log_dir);
m_logFile += homeDir;
- std::string fileName = UtilAll::to_string(getpid()) + "_" +
"rocketmq-cpp.log.%N";
+ std::string fileName = "rocketmq_client.log";
m_logFile += fileName;
// boost::log::expressions::attr<
// boost::log::attributes::current_thread_id::value_type>("ThreadID");
boost::log::register_simple_formatter_factory<boost::log::trivial::severity_level,
char>("Severity");
- m_logSink = logging::add_file_log(keywords::file_name = m_logFile,
keywords::rotation_size = 100 * 1024 * 1024,
+ m_logSink = logging::add_file_log(keywords::file_name = m_logFile,
+ keywords::target_file_name =
"rocketmq_client_%Y%m%d-%N.log",
+ keywords::rotation_size = 10 * 1024,
Review comment:
Make log name/dir compatible with RocketMQ main project, and rotation
size.
--
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]