Skip to content
This repository was archived by the owner on Mar 13, 2025. It is now read-only.

Commit 481dbad

Browse files
committed
Switching back to the custom logger.
1 parent d8b82bc commit 481dbad

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

app.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,11 @@
99
*/
1010
'use strict';
1111
const express = require('express');
12-
const logger = require('morgan');
12+
// const logger = require('morgan');
1313
const cookieParser = require('cookie-parser');
1414
const bodyParser = require('body-parser');
1515
const healthcheck = require('topcoder-healthcheck-dropin');
16+
const logger = require('./utils/logger');
1617

1718
/**
1819
* Method to check the service status
@@ -29,7 +30,7 @@ const webhooks = require('./routes/webhooks');
2930

3031
const app = express();
3132

32-
app.use(logger('dev'));
33+
// app.use(logger('dev'));
3334
app.use(bodyParser.json({
3435
verify: (req, res, buf) => {
3536
req.rawBody = buf.toString();
@@ -49,7 +50,7 @@ app.use((req, res, next) => {
4950
next(err);
5051
});
5152

52-
// error handler
53+
// // error handler
5354
app.use((err, req, res, next) => { // eslint-disable-line no-unused-vars
5455
console.log(err);
5556
res.status(err.status || 500); // eslint-disable-line no-magic-numbers
@@ -60,16 +61,20 @@ app.use((err, req, res, next) => { // eslint-disable-line no-unused-vars
6061
});
6162

6263
process.on('uncaughtException', (err) => {
64+
// logger.error('Exception: ', err);
6365
// Check if error related to Dynamodb conn
6466
if (err.code === 'NetworkingError' && err.region) {
6567
logger.error('DynamoDB connection failed.');
6668
}
6769
logger.logFullError(err, 'system');
70+
// console.log(err);
6871
});
6972

7073
// handle and log unhanled rejection
7174
process.on('unhandledRejection', (err) => {
75+
// logger.error('Rejection: ', err);
7276
logger.logFullError(err, 'system');
77+
// console.log(err);
7378
});
7479

7580
module.exports = app;

0 commit comments

Comments
 (0)