diff --git a/lib/logger.js b/lib/logger.js index d8c1a56e..78818ada 100644 --- a/lib/logger.js +++ b/lib/logger.js @@ -5,10 +5,17 @@ const options = require('./options') const logger = new winston.Logger({ level: options.logLevel, transports: [ - new (winston.transports.Console)({ timestamp: true, colorize: true }), + new (winston.transports.Console)({ + timestamp: true, + colorize: true, + handleExceptions: true, + humanReadableUnhandledException: true + }), new Postgres({ connectionString: options.postgresql, - tableName: 'server_logs' + tableName: 'server_logs', + handleExceptions: true, + humanReadableUnhandledException: true }) ], rewriters: [ diff --git a/lib/pg-transport.js b/lib/pg-transport.js index 65f39494..3d757a46 100644 --- a/lib/pg-transport.js +++ b/lib/pg-transport.js @@ -36,4 +36,8 @@ module.exports = class CustomTransport extends Transport { callback() } + + logException (msg, meta, callback) { + this.log('error', msg, meta, callback) + } }