Skip to content

Commit

Permalink
fix: improve logs
Browse files Browse the repository at this point in the history
  • Loading branch information
devthejo committed Dec 16, 2024
1 parent 18530ab commit b868ba1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
10 changes: 7 additions & 3 deletions packages/server/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ const loggerConfig = {
options: {
colorize: true,
levelFirst: true,
translateTime: 'SYS:standard'
ignore: 'pid,hostname,time'
}
},
level: process.env.DEBUG === 'true' ? 'debug' : 'info',
Expand All @@ -74,7 +74,9 @@ const loggerConfig = {
level: label
}
}
}
},
timestamp: false,
hostname: false
},
production: {
level: 'info',
Expand All @@ -84,7 +86,9 @@ const loggerConfig = {
level: label
}
}
}
},
timestamp: false,
hostname: false
}
};

Expand Down
2 changes: 1 addition & 1 deletion packages/server/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const port = config.port;
app.use(pinoHttp({
logger,
autoLogging: {
ignore: (req) => req.url === '/health'
ignore: (req) => req.url === '/health' || req.url === '/'
},
customLogLevel: function (res, err) {
if (res.statusCode >= 400 && res.statusCode < 500) return 'warn'
Expand Down

0 comments on commit b868ba1

Please sign in to comment.