bigbluebutton-Github/bigbluebutton-html5/imports/startup/server/logger.js
2018-02-22 13:45:29 -05:00

37 lines
690 B
JavaScript

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.log || {};
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;