cleaned up logs

This commit is contained in:
bill bittner 2017-06-19 19:46:39 -07:00
parent dbe83da336
commit 5f7177540c
2 changed files with 5 additions and 5 deletions

View file

@ -2,7 +2,7 @@ const logger = require('winston');
module.exports = { module.exports = {
handleRequestError (error, res) { handleRequestError (error, res) {
logger.error('Handling Request Error:', error); logger.error('Request Error,', error);
if (error === 'NO_CLAIMS' || error === 'NO_FREE_PUBLIC_CLAIMS') { if (error === 'NO_CLAIMS' || error === 'NO_FREE_PUBLIC_CLAIMS') {
res.status(307).render('noClaims'); res.status(307).render('noClaims');
} else if (error.response) { } else if (error.response) {
@ -14,7 +14,7 @@ module.exports = {
} }
}, },
handlePublishError (error) { handlePublishError (error) {
logger.error('Handling Publish Error:', error); logger.error('Publish Error,', error);
if (error.code === 'ECONNREFUSED') { if (error.code === 'ECONNREFUSED') {
return 'Connection refused. The daemon may not be running.'; return 'Connection refused. The daemon may not be running.';
} else if (error.response.data.error) { } else if (error.response.data.error) {

View file

@ -8,13 +8,13 @@ module.exports = (winston, logLevel, logDir) => {
winston.configure({ winston.configure({
transports: [ transports: [
new (winston.transports.Console)({ new (winston.transports.Console)({
level : logLevel, level : logLevel,
timestamp : false, timestamp : false,
colorize : true, colorize : true,
prettyPrint: true, prettyPrint: true,
}), }),
new (winston.transports.File)({ new (winston.transports.File)({
filename : `${logDir}speechLogs.log`, filename : `${logDir}speechLogs.log`,
level : logLevel, level : logLevel,
json : false, json : false,
@ -22,7 +22,7 @@ module.exports = (winston, logLevel, logDir) => {
colorize : true, colorize : true,
prettyPrint: true, prettyPrint: true,
}), }),
] ],
}); });
winston.handleExceptions(new winston.transports.File({ winston.handleExceptions(new winston.transports.File({