dcramer/raven — Issue #46: Customizing message via logging.error
Author: Ender27182818
Created: 2012-01-26 23:46:04+00:00
State: open

I'm currently using the following pattern in my code with raven

```python
import logging
try:
do_something()
except:
logger = logging.getLogger(MY_LOGGER)
logger.error("do_something failed badly", exc_info=True)
```

This works great in that it shows a stack trace and everything. The problem is that sentry (2.0.0RC7) shows the message as something like '__main__.do_something'. I can go in to the details of the message to see what my actual error message was, but it would be really nice to control the eventual 'culprit' value that raven passes on to sentry. Stepping through the RavenHandler code it looks like when exc_info=True culprit is entirely controlled by raven.utils.stacks.get_culprit.

It would be easiest if I could do something like

```python
logger.error('do_something failed badly", exc_info=True, extra={'culprit':'Do_something Failure'})
```

And have sentry show the message as 'Do_something Failure' rather than __main__.do_something

I'd be willing to submit a pull request, I just want to know if I do if it would be considered - I'm deploying this stuff to many, many servers via pip and I'd rather not fork this project just for this feature