Skip to content

Commit

Permalink
Reminder to myself uncensored URLs can appear in other platform logs.
Browse files Browse the repository at this point in the history
E.g. they appear in `heroku[router]` logs.
(#6)
  • Loading branch information
cben committed Feb 20, 2015
1 parent 74322aa commit e9a2cdc
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions server.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ server = http.createServer(st({
index: 'index.html'
}))
server.on 'request', (req, res) ->
# Note: full URLs might still appear in other platform logs, e.g. heroku[router]
anonimizedUrl = req.url.replace(/([?&])doc=[^&]*/, '$1doc=...')
# TODO: also log our responses, especially errors.
console.log('[%s] %s %s %s < %s %s', new Date().toISOString(), req.method, req.headers.host, anonimizedUrl, req.socket.remoteAddress, req.headers['user-agent'])
Expand Down

0 comments on commit e9a2cdc

Please sign in to comment.