FirstLegoLeague / fllscoring

FLL Scoring app. See Demo:
http://firstlegoleague.github.io/fllscoring/
GNU General Public License v2.0
14 stars 19 forks source link

Better logging #316

Closed poelstra closed 6 years ago

poelstra commented 6 years ago

localserver.js has logging, but it had issues:

New logging uses Apache-style logging, e.g.:

::1 - - [07/Jan/2018:13:46:20 +0000] "GET /admin HTTP/1.1" 200 1591 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/63.0.3239.84 Chrome/63.0.3239.84 Safari/537.36"
::1 - - [07/Jan/2018:13:46:20 +0000] "GET /fllscoring.appcache HTTP/1.1" 200 2064 "-" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/63.0.3239.84 Chrome/63.0.3239.84 Safari/537.36"
::1 - - [07/Jan/2018:13:46:20 +0000] "GET /components/bootstrap-css/css/bootstrap.min.css HTTP/1.1" 304 - "http://localhost:1390/admin" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/63.0.3239.84 Chrome/63.0.3239.84 Safari/537.36"
::1 - - [07/Jan/2018:13:46:20 +0000] "GET /js/config.js HTTP/1.1" 304 - "http://localhost:1390/admin" "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/63.0.3239.84 Chrome/63.0.3239.84 Safari/537.36"
coveralls commented 6 years ago

Coverage Status

Changes Unknown when pulling 38f0babd842c557efc43ffabc61f19393288759b on better_logging into on master.

coveralls commented 6 years ago

Coverage Status

Changes Unknown when pulling f013cf5e2f4056497bf41f60ffd688edd92188f2 on better_logging into on master.

poelstra commented 6 years ago

Oops, you're right! They were old commits that I still had lying around, and I thought I finished them back then...

That last middleware should have gone, but the rest of log.js probably needs to stay because it's also used for generic logging (i.e. not request-specific). That does mean the timestamp stuff in it needs to be fixed.

I.e. morgan is only used for logging the requests, it's not a generic logging mechanism.

I'll close this PR for now (working on other things in the mean time). I'll make a new one once I cleaned it up.