0

I'm integrating a logger on an Express app, and have replaced all console.log calls with our logger. Still stdout contains a line per request, and I can't find the place in our code that emits those.

1479433034910 INFO C:\work\Midburn\spark\app.js : Spark is starting...
1479433035437 INFO C:\work\Midburn\spark\app.js : Spark environment: NODE_ENV =
1479433035438 INFO C:\work\Midburn\spark\app.js : ------   Spark is running  ------
GET /he/home 302 24.940 ms - 84
1479433049833 INFO C:\work\Midburn\spark\routes\main_routes.js : /he/home
GET /he/login?r=/he/home 200 353.463 ms - 2454
GET /stylesheets/style.css 304 2.857 ms - -
GET /images/flags/he.gif 304 1.039 ms - -
GET /images/flags/en.gif 304 0.486 ms - -

What is generating the lines that start with GET?

ripper234
  • 222,824
  • 274
  • 634
  • 905
  • 1
    Post the middleware you set Express up with. Chances are if you used the "usual" Express middlewares you probably have `app.use(morgan('dev'));` in there. – Randy Nov 18 '16 at 01:57
  • @Randy indeed, morgan is the culprit - thanks! (post as an answer and I'll accept) – ripper234 Nov 18 '16 at 02:07

1 Answers1

2

In your Express setup somewhere you likely have this line:

app.use(morgan('dev'));

https://www.npmjs.com/package/morgan

HTTP request logger middleware for node.js

Randy
  • 4,351
  • 2
  • 25
  • 46