Skip to content

Commit

Permalink
Change logging to output time in ISO-8601
Browse files Browse the repository at this point in the history
  • Loading branch information
ingara committed Jan 14, 2021
1 parent aa43a95 commit b48d839
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions server/start.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ import cors from 'cors';
import express from 'express';
import exphbs from 'express-handlebars';
import helmet from 'helmet';
import pino from 'pino';
import pinoColada from 'pino-colada';
import pino from 'pino-http';
import pinoHttp from 'pino-http';

import * as Config from './config';
import routes from './routes';
Expand All @@ -15,7 +16,7 @@ export default function startServer() {
const app = express();

app.use(
pino({
pinoHttp({
...(Config.server.isDev
? {
prettyPrint: true,
Expand All @@ -27,6 +28,7 @@ export default function startServer() {
return { level };
},
},
timestamp: pino.stdTimeFunctions.isoTime,
genReqId(req) {
return req.headers['X-Correlation-ID'] || req.id;
},
Expand Down

0 comments on commit b48d839

Please sign in to comment.