flosight-api/lib/logger/index.js
tenthirtyone b028dead40 Initial Commit
Changelog:
Setup & Foundation
- bcoin
- express
- mongo
- eslint
- logging

Status: Bcoin syncs over network, uses a local leveldb to store blocks and checkpoints. Block event saves data to mongo. Express endpoint for block hashes, stubbed to reply with blockhashes until mongo models are finalized.

ToDo:
Move config out of code
2017-08-02 14:51:06 -04:00

18 lines
365 B
JavaScript

const winston = require('winston');
const logfile = new Date().toISOString();
const logger = new (winston.Logger)({
transports: [
new (winston.transports.Console)({
timestamp: true,
}),
new (winston.transports.File)({
filename: `logs/${logfile}.log`,
}),
],
});
logger.level = process.env.LOG || 'debug';
module.exports = logger;