Skip to content
Permalink
Browse files

Updates log format

  • Loading branch information
davidmerfield committed Oct 18, 2019
1 parent 99c321d commit 48e32e17ccc682f7b190c3d6ba195b412a0100f8
Showing with 2 additions and 2 deletions.
  1. +2 −2 app/index.js
@@ -27,10 +27,10 @@ Blot.use(helmet.frameguard("allow-from", config.host));
Blot.use(function(req, res, next){
var init = Date.now();

console.log('[' + clfdate(new Date()) +']', req.headers['x-request-id'], req.protocol + '://' + req.host + req.originalUrl);
console.log('[' + clfdate(new Date()) +']', req.headers['x-request-id'], 'REQ', req.protocol + '://' + req.hostname + req.originalUrl, req.method);

res.on('finish', function(){
console.log('[' + clfdate(new Date())+']', req.headers['x-request-id'], res.statusCode, Date.now() - init + 'ms', req.protocol + '://' + req.host + req.originalUrl);
console.log('[' + clfdate(new Date())+']', req.headers['x-request-id'], 'RES', req.protocol + '://' + req.hostname + req.originalUrl, res.statusCode, Date.now() - init + 'ms');
});

next();

0 comments on commit 48e32e1

Please sign in to comment.
You can’t perform that action at this time.