Converted the logger to be middleware for express