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

View file

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