This commit is contained in:
Hiro Protagonist 2016-09-09 14:23:37 +12:00
parent 3abe835452
commit 001dff8c9e

View file

@ -42,8 +42,8 @@ let logger = new(winston.Logger)({
colorize: true, colorize: true,
timestamp: true, timestamp: true,
json: true, json: true,
maxsize: 1000000, maxsize: 500000,
maxFiles: 1 maxFiles: 10
}) })
] ]
}); });
@ -326,12 +326,12 @@ var commandHandlers = function commandHandlers(command, cb) {
}); });
}, },
getLogs: function() { getLogs: function() {
fs.readFile(__dirname + '/process.log', 'utf-8', function(err, data) { logger.query({limit: 100}}, function (err, data) {
let lines; let lines;
if (err) { if (err) {
lines = []; lines = [];
} else } else
lines = data.trim().split('\n').slice(-100); lines = data;
if (lines.length === 1) if (lines.length === 1)
lines = []; lines = [];
socket.emit('data', { socket.emit('data', {