Added logging framework.

This commit is contained in:
baldo 2016-05-24 16:40:57 +02:00
parent ad3f075d93
commit a82b66c637
12 changed files with 171 additions and 29 deletions
server

30
server/logger.js Normal file
View file

@ -0,0 +1,30 @@
'use strict';
var config = require('./config');
var scribe = require('scribe-js')({
app: 'ffffng',
id: process.pid,
rootPath: config.server.logging.directory,
module: {
'router/Viewer': {
username: false,
password: false
}
}
});
process.console.addLogger('debug', 'grey', {
logInConsole: false
});
angular.module('ffffng').factory('Logger', function (app) {
app.use(scribe.express.logger());
app.use('/internal/logs', scribe.webPanel());
return process.console;
});
module.exports = process.console;