You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by GitBox <gi...@apache.org> on 2019/11/08 10:41:46 UTC

[GitHub] [nifi-minifi-cpp] nghiaxlee commented on a change in pull request #675: MINIFICPP-1063 - Log directory location should be configurable

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

 ##########
 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:
   Done, thanks for pointing out, funny that this thing was in our codebase for a long time but no such broken was reported

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services