Tradeshift/Buck — Issue #2: Wrong info logged to winston when serving static files
Author: kap0w
Created: 2011-11-22 22:10:12+00:00
State: open

Buck currently logs every request served with the winston plugin.

This shows up anyway, even when the file is served to the browser:

> info: Incoming Request url=/js/jq.js
> info: Request completed , method=GET, href=/js/jq.js, outcome=404
> info: Incoming Request url=/js/plug.js
> info: Request completed , method=GET, href=/js/plug.js, outcome=404
> info: Incoming Request url=/js/Client.js
> info: Request completed , method=GET, href=/js/Client.js, outcome=404

Every time the router serves a route it emits the 'log' event, but when the server handles static files it is done independently of our router.

So the router get the request and misses, emits the 'log' event, and then node-static handles the file and serves it to the browser.

This isn't that major, but it can get a little confusing while debugging if the router functions properly and you check the logs afterwards :)