Categories
express javascript node.js

How to log 500 status errors in console in express routes?

The typical errors I expect to see logged are not being logged in my express routes.
for example:

router.get('/', function(req,res,next){
console.log(undefinedVariable)
})

I expect to get an error:

ReferenceError: undefinedVarialbe is not defined;

however In the router.get I don’t get any errors other than:

GET / 500 3.641 ms – 478

in my console which is making debugging hard. Is there any way to get these errors to show in the console?