mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
add logging of request parameters to sentry
This commit is contained in:
parent
fd70f23e5c
commit
2e21da050c
2 changed files with 12 additions and 2 deletions
|
@ -19,11 +19,21 @@ module.exports = Logger =
|
|||
@logger.error(attributes, args...)
|
||||
if @raven?
|
||||
error = attributes.err or attributes.error
|
||||
req = attributes.req
|
||||
if error?
|
||||
tags = {}
|
||||
extra = {}
|
||||
for key, value of attributes
|
||||
tags[key] = value if key.match(/_id/) and typeof value == 'string'
|
||||
@raven.captureError(error, tags: tags, extra: attributes)
|
||||
extra[key] = value
|
||||
if req?
|
||||
extra.req =
|
||||
method: req.method
|
||||
url: req.originalUrl
|
||||
query: req.query
|
||||
headers: req.headers
|
||||
ip: req.ip
|
||||
@raven.captureError(error, {tags: tags, extra: extra})
|
||||
err: ()->
|
||||
@logger.error.apply(@logger, arguments)
|
||||
warn: ()->
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
"type": "git",
|
||||
"url": "http://github.com/sharelatex/logger-sharelatex.git"
|
||||
},
|
||||
"version": "1.2.1",
|
||||
"version": "1.3.0",
|
||||
"dependencies": {
|
||||
"bunyan": "1.5.1",
|
||||
"coffee-script": "1.4.0",
|
||||
|
|
Loading…
Reference in a new issue