bigbluebutton-Github/bigbluebutton-html5/imports/startup/server/logger.js

29 lines
620 B
JavaScript
Raw Normal View History

import { Meteor } from 'meteor/meteor';
import { createLogger, format, transports } from 'winston';
const LOG_CONFIG = Meteor?.settings?.private?.serverLog || {};
2019-08-03 01:20:06 +08:00
const { level } = LOG_CONFIG;
const Logger = createLogger({
2019-08-03 01:20:06 +08:00
level,
format: format.combine(
2018-12-10 09:08:16 +08:00
format.colorize({ level: true }),
format.splat(),
format.simple(),
),
2019-08-03 01:20:06 +08:00
transports: [
// console logging
new transports.Console({
prettyPrint: false,
humanReadableUnhandledException: true,
colorize: true,
handleExceptions: true,
level,
}),
],
});
export default Logger;
2017-06-03 03:25:02 +08:00
export const logger = Logger;