Closed bradsgreen closed 2 years ago
NOT A BUG!!!!
from honeybadger import honeybadger
honeybadger.configure(api_key='hbp_copoB504geiDXuwKF1rOwZimtN9APN3lqnKE')
# Install a honeybadger handler to report 'error' logs to HB
from honeybadger.contrib import HoneybadgerHandler
hb_handler = HoneybadgerHandler(api_key='hbp_copoB504geiDXuwKF1rOwZimtN9APN3lqnKE')
hb_handler.setLevel(logging.ERROR)
app.log.addHandler(hb_handler)
works -- you have to configure honeybadger to get the wrapping, creating the log handler doesn't do it for you. You might want to consider clarifying this in the documentation. but this is not a bug and can be closed.
Thanks!
(venv) xxx % python --version Python 3.8.2
hb_handler = HoneybadgerHandler(api_key='--my api key--') hb_handler.setLevel(logging.ERROR) app.log.addHandler(hb_handler)
@app.lambda_function() def honeybadger_error_test(event, context): app.log.error('Something went wrong!!!') app.log.info('But this is OK!') raise AssertionError("BOOM!")
results in "Something went wrong!!!" being reportied to HB but 'BOOM!' is not. Data attached. LMK if you'd prefer to reopen the old issue or I can create a new one.
CloudWatch logs indicate something odd:
[ERROR] 2021-09-13T22:16:55.509Z 133de542-7f45-4168-88a2-8924ad6fbbe2 Honeybadger API key missing from configuration: cannot report errors.
Full log:
Front conversations