bigbluebutton-Github/bigbluebutton-html5/imports/startup/server/logger.js
2018-07-31 15:28:03 -07:00

36 lines
695 B
JavaScript
Executable File

import { Meteor } from 'meteor/meteor';
import Winston from 'winston';
const Logger = new Winston.Logger();
Logger.configure({
levels: {
error: 0, warn: 1, info: 2, verbose: 3, debug: 4,
},
colors: {
error: 'red',
warn: 'yellow',
info: 'green',
verbose: 'cyan',
debug: 'magenta',
},
});
Meteor.startup(() => {
const LOG_CONFIG = Meteor.settings.private.serverLog || {};
const { level } = LOG_CONFIG;
// console logging
Logger.add(Winston.transports.Console, {
prettyPrint: false,
humanReadableUnhandledException: true,
colorize: true,
handleExceptions: true,
level,
});
});
export default Logger;
export const logger = Logger;