我在 GAE 中有一个使用 python 的项目,我在其中设置了 rollbar 来跟踪任何错误和异常。错误报告在 localhost 上工作,但是一旦我部署它,我的应用程序就不会发送我有意创建的任何错误日志/信息。
我将滚动条设置如下:
import rollbar
rollbar.init('xxxxxxxxxxxxxxxxxxxx', 'production')
..
..
#when an error occur
try:
....
except:
rollbar.report_exc_info()
更新(11/20):
我现在可以让 rollbar 工作,但必须使用旧版本的 requests 库(版本 2.3.0)。较新的版本,例如 2.7.0 或 2.8.1 会给我一个连接错误,有人知道为什么或如何解决吗?
ERROR 2015-11-20 17:44:03,543 __init__.py:1158] Exception while posting item ConnectionError(ProtocolError('Connection aborted.', error(13, 'Permission denied')),)
Traceback (most recent call last):
File "/Path/to/my/project/rollbar/__init__.py", line 1156, in _send_payload
_post_api('item/', payload, access_token=access_token)
File "/Path/to/my/project/rollbar/__init__.py", line 1197, in _post_api
verify=SETTINGS.get('verify_https', True))
File "/Path/to/my/project/requests/api.py", line 109, in post
return request('post', url, data=data, json=json, **kwargs)
File "/Path/to/my/project/requests/api.py", line 50, in request
response = session.request(method=method, url=url, **kwargs)
File "/Path/to/my/project/requests/sessions.py", line 468, in request
resp = self.send(prep, **send_kwargs)
File "/Path/to/my/project/requests/sessions.py", line 576, in send
r = adapter.send(request, **kwargs)
File "/Path/to/my/project/requests/adapters.py", line 412, in send
raise ConnectionError(err, request=request)
ConnectionError: ('Connection aborted.', error(13, 'Permission denied'))