Skip to content

Node.js based forum software built for the modern web

use base_dir

barisusaklid3fff28de587
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