Skip to content

Instantly share code, notes, and snippets.

@jcperez
Created July 20, 2018 08:41
Show Gist options
  • Save jcperez/c586b2dd873309b302c86fbc04562fcb to your computer and use it in GitHub Desktop.
Save jcperez/c586b2dd873309b302c86fbc04562fcb to your computer and use it in GitHub Desktop.
function logger(message) {
console.log(`${session.get('request-id')} - ${message}`);
}
app.get('/', (req, res) => {
logger(`Request to ${req.path}`);
res.send(`Request completed - ${session.get('request-id')}`);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment