Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Errors and warning are written to console #185

Open
laino opened this issue Nov 12, 2016 · 2 comments
Open

Errors and warning are written to console #185

laino opened this issue Nov 12, 2016 · 2 comments

Comments

@laino
Copy link

laino commented Nov 12, 2016

node-static is spamming console.error with useless stack traces when receiving "invalid" range headers and the like. It would be nice if those warning could at least be intercepted, so they can be funneled through custom logging and the like.

Maybe an "error" event, where if there are no even listeners registered the error gets printed to the console?

Currently I get a few of these every second, which makes my log files.... very unreadable:

Request contains invalid range header:  [ '13620', '13620' ]
Error: Range request present but invalid, might serve whole file instead
    at Server.respondNoGzip (/var/volafile/app/node_modules/node-static/lib/node-static.js:300:23)
    at /var/volafile/app/node_modules/node-static/lib/node-static.js:224:18
    at FSReqWrap.oncomplete (fs.js:111:15)
@nhrones
Copy link

nhrones commented Dec 28, 2016

I'm getting same warnings, but only when I'm serving to Chrome-on-Android?

@andrewhodel
Copy link

This is the same issue as #212.

This is about standard output and standard error, as it is consistently request-able from any HTTP client to any HTTP server using node-static, it should not be printed to standard output or standard error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants