mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-05-23 17:19:37 +02:00
add logging of request parameters to sentry
This commit is contained in:
@@ -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",
|
||||
|
||||
Reference in New Issue
Block a user