Aashish P
Aashish P

Reputation: 1956

Unable to send notification to errbit

I am using Python's https://github.com/pulseenergy/airbrakepy Which is a synonym to Ruby's Airbrake gem. Now, i have installed https://github.com/errbit/errbit at my end. Now, i want to send all error notices to errbit. I have something similar to,

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()

I also have .airbrakepy which has api_key and errbit_url.

Anybody knows where am i making mistake.

I am not able to send notices to errbit through this method.

Upvotes: 1

Views: 477

Answers (1)

Aashish P
Aashish P

Reputation: 1956

Please use https://github.com/aashish-pathak/airbrakepy

There is some issue with airbrakepy. I'll soon send pull request to main airbrakepy repo.

Upvotes: 0

Related Questions