move log output endpoint to server, out of api

also, auto-detect websockets url scheme based on current url scheme (https ->
wss, http -> ws)