bigbluebutton-Github/bigbluebutton-html5/imports/startup/server/logger.js
2018-12-10 01:08:16 +00:00

29 lines
617 B
JavaScript

import { Meteor } from 'meteor/meteor';
import { createLogger, format, transports } from 'winston';
const Logger = createLogger({
format: format.combine(
format.colorize({ level: true }),
format.splat(),
format.simple(),
),
});
Meteor.startup(() => {
const LOG_CONFIG = Meteor.settings.private.serverLog || {};
const { level } = LOG_CONFIG;
// console logging
Logger.add(new transports.Console(), {
prettyPrint: false,
humanReadableUnhandledException: true,
colorize: true,
handleExceptions: true,
level,
});
});
export default Logger;
export const logger = Logger;