Last active
August 29, 2015 14:01
-
-
Save nikhilw/aebc424aa7b74b58a3d2 to your computer and use it in GitHub Desktop.
Reuse a built-in logging format for Node/Express/Morgan
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
logger.format("mine", function(tokens, req, res) { | |
var dt = new Date; | |
// Key being: all the logging format added internally are available directly as methods: .dev/.default/.full etc | |
return "" + dt.getDate() + dt.getMonth() + dt.getYear() +"_"+ dt.getHours() + dt.getMinutes() + dt.getSeconds() + " : " + logger.dev(tokens, req, res); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment