diff --git a/bin/config.js b/bin/config.js index 008bb22..f99b541 100644 --- a/bin/config.js +++ b/bin/config.js @@ -9,7 +9,9 @@ module.exports = { log: { - directory: global['__dirname'] + "/logs/", + directory: () => { + return global['__dirname'] + "/logs/" + }, filename: () => { return (new Date()).toISOString().substr(0, 10) + ".log" } diff --git a/bin/logs/module.js b/bin/logs/module.js index 3e5e1e6..6fd2be4 100644 --- a/bin/logs/module.js +++ b/bin/logs/module.js @@ -15,7 +15,7 @@ let util = require('util'); newLine = (prefix, obj) => { let date = new Date(); // current date let filename = global['gds'].cfg.log.filename(); // filename - let dir = global['gds'].cfg.log.directory; // directory + let dir = global['gds'].cfg.log.directory(); // directory let path = dir + filename; // filepath let fs_options = { // fs options for encoding, file mode and file flag encoding: "utf8",