arpadboda commented on a change in pull request #675: MINIFICPP-1063 - Log 
directory location should be configurable
URL: https://github.com/apache/nifi-minifi-cpp/pull/675#discussion_r343152261
 
 

 ##########
 File path: libminifi/src/core/logging/LoggerConfiguration.cpp
 ##########
 @@ -135,31 +135,34 @@ std::shared_ptr<internal::LoggerNamespace> 
LoggerConfiguration::initialize_names
     if ("nullappender" == appender_type || "null appender" == appender_type || 
"null" == appender_type) {
       sink_map[appender_name] = 
std::make_shared<spdlog::sinks::null_sink_st>();
     } else if ("rollingappender" == appender_type || "rolling appender" == 
appender_type || "rolling" == appender_type) {
-      std::string file_name = "";
+      std::string file_name;
       if (!logger_properties->get(appender_key + ".file_name", file_name)) {
         file_name = "minifi-app.log";
       }
-      std::string directory = "";
-      directory = logger_properties->getHome();
-      if (!directory.empty()) {
-        // Create the log directory if needed
-        directory += "/logs";
+      std::string directory;
+      if (!logger_properties->get(appender_key + ".directory", directory)) {
+        // The below part assumes logger_properties->getHome() is existing
+        // Cause minifiHome must be set at MiNiFiMain.cpp?
+        directory = logger_properties->getHome() + "/logs";
 
 Review comment:
   Please use _get_separator_ from _FileUtils_, this would break logging on Win!

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to