Skip to content
This repository has been archived by the owner on Nov 30, 2023. It is now read-only.

Commit

Permalink
Merge pull request #27 from karenhanson/print-env-vars
Browse files Browse the repository at this point in the history
Add printout of variables on app run
  • Loading branch information
jrmartino authored Oct 19, 2018
2 parents 63bbf97 + 3338803 commit 3f7073e
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,21 @@ public void run() {
+ "To use a config file, create a file named \"{}\" in the app's folder or provide a valid path "
+ "using the \"{}\" environment variable.", configFile.getAbsolutePath(), DEFAULT_CONFIG_FILENAME, NIHMS_CONFIG_FILEPATH_PROPKEY);
}

if (LOG.isDebugEnabled()) {
StringBuilder props = new StringBuilder("\n"
+ "--------------------------------------------------------------\n"
+ "* PROPERTIES *\n"
+ "--------------------------------------------------------------\n");

props.append(NIHMS_CONFIG_FILEPATH_PROPKEY + ": " + configFile.toString());

for (String key : SYSTEM_PROPERTIES) {
props.append(key + ": " + ConfigUtil.getSystemProperty(key, "{uses_default}"));
}
props.append("--------------------------------------------------------------\n");
LOG.debug(props.toString());
}

NihmsHarvester harvester = new NihmsHarvester();
harvester.harvest(statusesToProcess, startDate);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,9 @@ public class NihmsTransformLoadApp {
*/
private static final String[] SYSTEM_PROPERTIES = {"pass.fedora.user", "pass.fedora.password",
"pass.fedora.baseurl", "pass.elasticsearch.url",
"pass.elasticsearch.limit","nihmsetl.repository.uri",
"nihmsetl.pmcurl.template", "nihmsetl.loader.cachepath"};
"pass.elasticsearch.limit", "nihmsetl.data.dir",
"nihmsetl.repository.uri", "nihmsetl.pmcurl.template",
"nihmsetl.loader.cachepath"};

private Set<NihmsStatus> statusesToProcess;

Expand Down Expand Up @@ -80,6 +81,21 @@ public void run() {
+ "using the \"nihms.config.filepath\" environment variable.", configFile.getAbsolutePath(), DEFAULT_CONFIG_FILENAME);
}

if (LOG.isDebugEnabled()) {
StringBuilder props = new StringBuilder("\n"
+ "--------------------------------------------------------------\n"
+ "* PROPERTIES *\n"
+ "--------------------------------------------------------------\n");

props.append(NIHMS_CONFIG_FILEPATH_PROPKEY + ": " + configFile.toString());

for (String key : SYSTEM_PROPERTIES) {
props.append(key + ": " + ConfigUtil.getSystemProperty(key, "{uses_default}"));
}
props.append("--------------------------------------------------------------\n");
LOG.debug(props.toString());
}

NihmsTransformLoadService service = new NihmsTransformLoadService();
service.transformAndLoadFiles(statusesToProcess);

Expand Down

0 comments on commit 3f7073e

Please sign in to comment.