Sentry-python: logbook Integration

Created on 5 Aug 2019  路  6Comments  路  Source: getsentry/sentry-python

The old raven client integrated with logbook. Is this planned for the new SDK as well?

enhancement

Most helpful comment

Ohh, I forgot about this. Yes, I ended up copy-pasting https://github.com/getsentry/sentry-python/blob/master/sentry_sdk/integrations/logging.py#L153-L210 but inheriting from logbook.Handler instead of from logging.Handler, and changing some attribute names from record.

It's not very pretty but here's a Gist if you find it useful. https://gist.github.com/nip3o/eb938f898c379cd847cba3af49b69cb7

All 6 comments

It's not planned yet but if people are asking for it we will prioritize of course.

I just discovered this as we are migrating from Raven to the new SDK. Going to try to hack something together, might submit a PR if it turns out good.

@nip3o did you migrate Logbook handler from raven to sentry_sdk?

Ohh, I forgot about this. Yes, I ended up copy-pasting https://github.com/getsentry/sentry-python/blob/master/sentry_sdk/integrations/logging.py#L153-L210 but inheriting from logbook.Handler instead of from logging.Handler, and changing some attribute names from record.

It's not very pretty but here's a Gist if you find it useful. https://gist.github.com/nip3o/eb938f898c379cd847cba3af49b69cb7

thank you. It seem like you have implemented raven logic to handle record. I mean you have manually added new event handler to logbook handler's stack.
But logging integration patching logging library. Anyway thank you, i have missed EventHandler when looking to the code.

@nip3o I forked your code to add breadcrumb support: https://gist.github.com/miracle2k/a3eb2350e73ca025eaca84ced48fdabf

Was this page helpful?
0 / 5 - 0 ratings

Related issues

MaximZemskov picture MaximZemskov  路  3Comments

CasperCL picture CasperCL  路  7Comments

lucas03 picture lucas03  路  3Comments

xarg picture xarg  路  6Comments

amureki picture amureki  路  6Comments