log.js
329 Bytes
const bunyan = require('bunyan');
const config = require('./config');
let bunyanConfig = {
name: 'yourapp',
src: true,
streams: [{
path: './logs/yourapp.log',
level: 'info',
name: 'info'
}],
level: 'error',
serializers: bunyan.stdSerializers
};
const log = bunyan.createLogger(bunyanConfig);
module.exports = log;