Github user minifirocks commented on a diff in the pull request:
https://github.com/apache/nifi-minifi-cpp/pull/236#discussion_r161295854
--- Diff: libminifi/src/core/logging/LoggerConfiguration.cpp ---
@@ -110,6 +112,17 @@ std::shared_ptr<internal::LoggerNamespace>
LoggerConfiguration::initialize_names
if (!logger_properties->get(appender_key + ".file_name", file_name))
{
file_name = "minifi-app.log";
}
+ std::string directory = "";
+ if (logger_properties->get(appender_key + ".directory", directory)) {
+ // Create the log directory if needed
+ struct stat logDirStat;
+ if (stat(directory.c_str(), &logDirStat) != 0 ||
!S_ISDIR(logDirStat.st_mode)) {
+ if (mkdir(directory.c_str(), 0777) == -1) {
--- End diff --
we read the directory variable from minifi-log.properties which specify the
log name and log directory.
the directory can be a absolute path or relative path.
---