feat: add new server log page

This commit is contained in:
Luis Félix 2019-11-12 11:15:00 +00:00
parent fc1951c4b2
commit 703c5d7c91
38 changed files with 2844 additions and 29 deletions

View file

@ -1,11 +1,15 @@
const winston = require('winston')
const Postgres = require('./pg-transport')
const options = require('./options')
const _ = require('lodash/fp')
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 }),
new Postgres({
connectionString: options.postgresql,
tableName: 'server_logs'
})
],
rewriters: [
(...[,, meta]) => meta instanceof Error ? { message: meta.message, stack: meta.stack } : meta