From d3fff28de587a71e2e84dbf5a223a68fe5a4531d Mon Sep 17 00:00:00 2001 From: barisusakli Date: Wed, 23 Nov 2016 21:23:37 +0300 Subject: [PATCH] use base_dir --- src/meta/logs.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/meta/logs.js b/src/meta/logs.js index b335ff281e..32f6d7a141 100644 --- a/src/meta/logs.js +++ b/src/meta/logs.js @@ -1,17 +1,17 @@ 'use strict'; var path = require('path'); +var nconf = require('nconf'); var fs = require('fs'); var winston = require('winston'); module.exports = function (Meta) { - Meta.logs = { - path: path.join('logs', path.sep, 'output.log') + path: path.join(nconf.get('base_dir'), 'logs', 'output.log') }; Meta.logs.get = function (callback) { - fs.readFile(this.path, { + fs.readFile(Meta.logs.path, { encoding: 'utf-8' }, function (err, logs) { if (err) { @@ -23,6 +23,7 @@ module.exports = function (Meta) { }; Meta.logs.clear = function (callback) { - fs.truncate(this.path, 0, callback); + fs.truncate(Meta.logs.path, 0, callback); }; + }; \ No newline at end of file