bithavoc / express-winston

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

Question/Feature Request: Replace express logs #146

Closed justinIs closed 7 years ago

justinIs commented 7 years ago

I've implemented the express logger and I'm adding the logger before any routes are added to my express app.

I see the logs being output to the console in exactly the format I desire, however the regular express logs for routes are being logged as well:

{"timestamp":1489696315967,"level":"INFO","message":"HTTP GET /wireless","req":{"query":{}},"responseTime":388,"statusCode":200,"method":"GET","url":"/wireless"}
GET /wireless 200 396ms - 100.12kb

Notice the first log line is in JSON format, and is how I want my logs to look. But the second line has the same log that express generates when hitting a route. I want to not log the second line.

I've gone through the documentation for this library and can't seem to find any way of disabling that. Am I missing something?

justinIs commented 7 years ago

Closing this as I realized I was using morgan for logging as well.

rosston commented 7 years ago

🙂 That was going to be my first question. Glad you got it figured out!