Fix logging tags
This commit is contained in:
parent
0d2eba47ec
commit
d4bc256548
2
index.js
2
index.js
@ -56,6 +56,6 @@ process.on('SIGINT', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
process.on('uncaughtException', err => {
|
process.on('uncaughtException', err => {
|
||||||
log.error('server', 'Uncaught exception', err);
|
log.error('index', 'Uncaught exception', err);
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
});
|
});
|
@ -85,9 +85,9 @@ app.on('error', (error, ctx) => {
|
|||||||
if (error.status) {
|
if (error.status) {
|
||||||
ctx.status = error.status;
|
ctx.status = error.status;
|
||||||
ctx.body = error.message;
|
ctx.body = error.message;
|
||||||
log.verbose('worker', 'Request faild: %s, %s', error.status, error.message);
|
log.verbose('app', 'Request faild: %s, %s', error.status, error.message);
|
||||||
} else {
|
} else {
|
||||||
log.error('worker', 'Unknown error', error, ctx);
|
log.error('app', 'Unknown error', error, ctx);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -113,7 +113,7 @@ function readCredentials() {
|
|||||||
try {
|
try {
|
||||||
return require('../credentials.json');
|
return require('../credentials.json');
|
||||||
} catch(e) {
|
} catch(e) {
|
||||||
log.info('worker', 'No credentials.json found ... using environment vars.');
|
log.info('app', 'No credentials.json found ... using environment vars.');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -125,7 +125,7 @@ if (!global.testing) { // don't automatically start server in tests
|
|||||||
co(function *() {
|
co(function *() {
|
||||||
let app = yield init();
|
let app = yield init();
|
||||||
app.listen(config.server.port);
|
app.listen(config.server.port);
|
||||||
}).catch(err => log.error('worker', 'Initialization failed!', err));
|
}).catch(err => log.error('app', 'Initialization failed!', err));
|
||||||
}
|
}
|
||||||
|
|
||||||
function *init() {
|
function *init() {
|
||||||
|
Loading…
Reference in New Issue
Block a user