我使用的是Python的https://github.com/pulseenergy/airbrakepy,它是Ruby的Airbrake gem的同义词。现在,我已经在我的终端安装了https://github.com/errbit/errbit。现在,我要将所有错误通知发送到errbit。我有类似的东西,
import logging
import ConfigParser
import os
import time
from airbrakepy.logging.handlers import AirbrakeHandler
def method_three():
raise StandardError('bam, pow')
def method_two():
method_three()
def method_one():
method_two()
if __name__=='__main__':
configFilePath = os.path.join(os.path.expanduser("~"), ".airbrakepy")
print(configFilePath)
parser = ConfigParser.SafeConfigParser()
parser.read(configFilePath)
api_key = parser.get("airbrake", "api_key")
url = parser.get("airbrake", "app_url")
logging.basicConfig(level=logging.ERROR)
logger = logging.getLogger("test-logger")
handler = AirbrakeHandler(api_key, environment='dev', component_name='integration-test', node_name='server', airbrake_url=url, use_ssl=False, timeout_in_ms=10000000)
logger.addHandler(handler)
logger.error("before exception")
try:
method_one()
except StandardError:
logger.error("test with exception", exc_info=True)
logger.error("test without exception", exc_info=False)
logger.error("after exception")
logging.shutdown()我还有.airbrakepy,它有api_key和errbit_url。
任何人都知道我在哪里做错了。
我无法通过此方法向errbit发送通知。
发布于 2013-09-15 17:54:08
请使用https://github.com/aashish-pathak/airbrakepy
airbrakepy有一些问题。我很快就会向主airbrakepy回收站发送请求。
https://stackoverflow.com/questions/18760700
复制相似问题