Closed kvz closed 6 years ago
generally, uppy-server prepends useful logs with uppy-server
using this function https://github.com/transloadit/uppy-server/blob/master/src/uppy.js#L149 Although this is not the case for errors and it should be addressed, the aforementioned log are just left for dev purposes (as uppy-server is not yet stable), and should be removed
Currently uppy server logs things like:
If we need this log at all, it would be better to use full sentences to describe what is going on. This makes it possible to set up search patterns in the log aggregator, view individual lines without viewing others, set up alerts, etc.
I also noticed that it might be nice to have more logs in general about what is going on, and maybe settle on a prefix like an ISO 8601 date with a syslog severity log level like:
2018-02-07 10:20:21Z [debug] Something uninteresting happened
2018-02-07 10:20:21Z [info] Something slightly interesting happened
2018-02-07 10:20:21Z [notice] Something interesting happened
2018-02-07 10:20:21Z [warning] Something bad could be happening
2018-02-07 10:20:21Z [err] Something bad happened
2018-02-07 10:20:21Z [crit] Something super bad happened
2018-02-07 10:20:21Z [alert] Something super bad happened that (in production) warrants a pagerduty and someone to be woken up
2018-02-07 10:20:21Z [emerg] Something super bad happened that (in production) warrants a pagerduty and someone to be woken up, and the process halts
That's a lot of levels, I'd propose to only pick
debug
info
err
emerg
from these for starters.This again helps with setting up graphs and alerts for errors, and e.g. allow to not show debug logs, under which I'd categorize the webserver access logs such as
::ffff:127.0.0.1 - - [07/Feb/2018:10:34:57 +0000] "GET /instagram/authorized HTTP/1.1" 200 22 "http://localhost:3000/dash/uppy.html" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36"
I don't think we need a fancy framework or anything, in the end it's just about writing to the stdout/err. simple log functions will do the trick imho: