What's the best practice for expressjs logging?

We use winston, it's probably the most robust logging package out there.

We ended up setting it up exactly like you suggested. Creating a common library used for wrapping the logger object around our definitions and transports, and then handling any other type of objects we want to be handled differently.

https://gist.github.com/rtgibbons/7354879


If you're using express you may want to look at express-winston package. Then you can use winston as middleware and easily log requests/errors without making your code messy...