Skip to content

Commit

Permalink
logger time stamp
Browse files Browse the repository at this point in the history
  • Loading branch information
manupanand committed Nov 13, 2024
1 parent 775dfec commit 6e4cdde
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/config/logger.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const { combine, timestamp, json, colorize } = format;
const consoleLogFormat = format.combine(
format.colorize(),
format.printf(({ level, message, timestamp }) => {
return `${level}: ${message}`;
return `${level}:${timestamp}: ${message}`;
})
);

Expand Down
4 changes: 3 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,5 +39,7 @@ databaseConnection()

//server
app.listen('2500','0.0.0.0',()=>{
logger.info("Server started listening to port 2500")
try{logger.info("Server started succesfully on port :2500")}catch(error){
logger.error("Error in starting server",error)
}
})

0 comments on commit 6e4cdde

Please sign in to comment.