Make logger path configurable

This commit is contained in:
Jonathan Barrow
2023-02-28 20:27:59 -05:00
parent b655fec99a
commit e164950390
2 changed files with 4 additions and 1 deletions

View File

@@ -72,6 +72,7 @@ function configure() {
logger.info('Loading config from environment variable');
config = {
logger_path: process.env.PN_ACT_LOGGER_PATH,
http: {
port: Number(process.env.PN_ACT_CONFIG_HTTP_PORT)
},

View File

@@ -1,7 +1,9 @@
const fs = require('fs-extra');
require('colors');
const root = __dirname;
const { config } = require('./config-manager');
const root = config.logger_path ? config.logger_path : `${__dirname}/..`;
fs.ensureDirSync(`${root}/logs`);
const streams = {