You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@nifi.apache.org by minifirocks <gi...@git.apache.org> on 2018/01/10 16:51:06 UTC
[GitHub] nifi-minifi-cpp pull request #236: MINIFICPP-337: make default log directory...
GitHub user minifirocks opened a pull request:
https://github.com/apache/nifi-minifi-cpp/pull/236
MINIFICPP-337: make default log directory as logs
Thank you for submitting a contribution to Apache NiFi - MiNiFi C++.
In order to streamline the review of the contribution we ask you
to ensure the following steps have been taken:
### For all changes:
- [ ] Is there a JIRA ticket associated with this PR? Is it referenced
in the commit message?
- [ ] Does your PR title start with MINIFI-XXXX where XXXX is the JIRA number you are trying to resolve? Pay particular attention to the hyphen "-" character.
- [ ] Has your PR been rebased against the latest commit within the target branch (typically master)?
- [ ] Is your initial contribution a single, squashed commit?
### For code changes:
- [ ] If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under [ASF 2.0](http://www.apache.org/legal/resolved.html#category-a)?
- [ ] If applicable, have you updated the LICENSE file?
- [ ] If applicable, have you updated the NOTICE file?
### For documentation related changes:
- [ ] Have you ensured that format looks appropriate for the output in which it is rendered?
### Note:
Please ensure that once the PR is submitted, you check travis-ci for build issues and submit an update to your PR as soon as possible.
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/minifirocks/nifi-minifi-cpp MINIFICPP-337
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/nifi-minifi-cpp/pull/236.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #236
----
commit de8a48c8b15bdec4d5083af2088e5b308faf5ef7
Author: Bin Qiu <be...@...>
Date: 2018-01-10T16:49:58Z
MINIFICPP-337: make default log directory as logs
----
---
[GitHub] nifi-minifi-cpp issue #236: MINIFICPP-337: make default log directory as log...
Posted by minifirocks <gi...@git.apache.org>.
Github user minifirocks commented on the issue:
https://github.com/apache/nifi-minifi-cpp/pull/236
@apiri using MINIFI_HOME/logs. please review
---
[GitHub] nifi-minifi-cpp issue #236: MINIFICPP-337: make default log directory as log...
Posted by apiri <gi...@git.apache.org>.
Github user apiri commented on the issue:
https://github.com/apache/nifi-minifi-cpp/pull/236
updates look good. thanks will get this merged. going to open another ticket to have a property that allow configuration of the location of the logs but this behavior will be have a little more as expected.
---
[GitHub] nifi-minifi-cpp pull request #236: MINIFICPP-337: make default log directory...
Posted by asfgit <gi...@git.apache.org>.
Github user asfgit closed the pull request at:
https://github.com/apache/nifi-minifi-cpp/pull/236
---
[GitHub] nifi-minifi-cpp pull request #236: MINIFICPP-337: make default log directory...
Posted by minifirocks <gi...@git.apache.org>.
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.
---
[GitHub] nifi-minifi-cpp pull request #236: MINIFICPP-337: make default log directory...
Posted by minifirocks <gi...@git.apache.org>.
Github user minifirocks commented on a diff in the pull request:
https://github.com/apache/nifi-minifi-cpp/pull/236#discussion_r161296430
--- 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 --
so if you start bin/minifi.sh, the log directory will be ./logs where you start the same
---
[GitHub] nifi-minifi-cpp pull request #236: MINIFICPP-337: make default log directory...
Posted by apiri <gi...@git.apache.org>.
Github user apiri commented on a diff in the pull request:
https://github.com/apache/nifi-minifi-cpp/pull/236#discussion_r161024930
--- 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 --
How directory is handled here will not make this within the root of the minifi deployment and will be relative to where the call is invoked from. So if I perform a minifi.sh start, it will do so from the logs directory of where I started and not within my minifi installation.
---