Skip to content

Commit

Permalink
Changed the logger to reduce undefined stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
smaharj1 committed Jul 4, 2020
1 parent 67e0614 commit 526411f
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion management-server/bin/www
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ if (cluster.isMaster) {
var server = http.createServer(app);
server.listen(port);

console.log(`[CLUSTER]: Worker ${process.pid} started`);
console.log(`[CLUSTER]: Worker ${process.pid} started at port ${port}`);
}

// OPTION 2: WITHOUT CLUSTER
Expand Down
2 changes: 1 addition & 1 deletion management-server/logging/logger.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const logger = winston.createLogger({
winston.format.colorize(),
winston.format.timestamp(),
winston.format.align(),
winston.format.printf(info => `${info.timestamp} ${info.level}: ${info.message} ${info.meta}`)
winston.format.printf(info => `${info.timestamp} ${info.level}: ${info.message} ${info.meta ? info.meta : ''}`)
),
transports: [
new winston.transports.File({
Expand Down
2 changes: 1 addition & 1 deletion shopping-server/bin/www
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ if (cluster.isMaster) {
var server = http.createServer(app);
server.listen(port);

console.log(`[CLUSTER]: Worker ${process.pid} started`);
console.log(`[CLUSTER]: Worker ${process.pid} started at port ${port}`);
}

// OPTION 2: WITHOUT CLUSTER
Expand Down
2 changes: 1 addition & 1 deletion shopping-server/logging/logger.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const logger = winston.createLogger({
winston.format.colorize(),
winston.format.timestamp(),
winston.format.align(),
winston.format.printf(info => `${info.timestamp} ${info.level}: ${info.message} ${info.meta}`)
winston.format.printf(info => `${info.timestamp} ${info.level}: ${info.message} ${info.meta ? info.meta : ''}`)
),
transports: [
new winston.transports.File({
Expand Down

0 comments on commit 526411f

Please sign in to comment.