feat: decouple l-s entrypoint

This commit is contained in:
Sérgio Salgado 2022-03-29 15:00:52 +01:00
parent 2a2c1fccc8
commit f4d6b5e454
48 changed files with 411 additions and 232 deletions

View file

@ -1,9 +1,11 @@
const winston = require('winston')
const Postgres = require('./pg-transport')
const options = require('./options')
const { PSQL_URL } = require('./constants')
const LOG_LEVEL = process.env.LOG_LEVEL
const logger = new winston.Logger({
level: options.logLevel,
level: LOG_LEVEL,
transports: [
new (winston.transports.Console)({
timestamp: true,
@ -12,7 +14,7 @@ const logger = new winston.Logger({
humanReadableUnhandledException: true
}),
new Postgres({
connectionString: options.postgresql,
connectionString: PSQL_URL,
tableName: 'server_logs',
handleExceptions: true,
humanReadableUnhandledException: true