Skip to content

Commit

Permalink
fix: default NODE_LOG_DIR will never use pm2_env.NODE_LOG_DIR
Browse files Browse the repository at this point in the history
Refs: #25
  • Loading branch information
peze committed Nov 12, 2019
1 parent aba8e22 commit 8ad1244
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions get_process_env.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ function getProcessEnv(pid) {
});
const lines = output.split('\u0000');

var env = {ENABLE_NODE_LOG: '', NODE_LOG_DIR: '/tmp'};
var env = { ENABLE_NODE_LOG: '', NODE_LOG_DIR: '' };
var pm2_env = {};

for (var i = 0; i < lines.length; i++) {
Expand All @@ -65,7 +65,7 @@ function getProcessEnv(pid) {
}
}

env.NODE_LOG_DIR = env.NODE_LOG_DIR || pm2_env.NODE_LOG_DIR;
env.NODE_LOG_DIR = env.NODE_LOG_DIR || pm2_env.NODE_LOG_DIR || '/tmp';
env.ENABLE_NODE_LOG = env.ENABLE_NODE_LOG || pm2_env.ENABLE_NODE_LOG;

if (!env.NODE_LOG_DIR.endsWith('/')) {
Expand Down

0 comments on commit 8ad1244

Please sign in to comment.