bithavoc / express-winston

express.js middleware for winstonjs
https://www.npmjs.com/package/express-winston
MIT License
797 stars 187 forks source link

Unable to log errors in an app that is not using router. #132

Closed muditjuneja closed 7 years ago

muditjuneja commented 7 years ago

I an using routes like app.get("/api/product", productController.get);

I am able to use the Request logging by using app.use(expressWinston.logger({ transports: [ new (winston.transports.File)({ filename: 'Requests.log' }) ] }));

But I am unable to log errors like app.use(expressWinston.errorLogger({ transports: [ new (winston.transports.File)({ filename: 'Errors.log' }) ] }));

Can anyone help me?

rosston commented 7 years ago

I just tested error logging in the same sort of scenario you have shown here, and it worked fine. Perhaps you can put together an example repository with minimal code that shows the problem? Otherwise, I'll mostly just be guessing at what's wrong.

rosston commented 7 years ago

Closing due to inactivity.