Not all issues are passing through the raven filter? Python + Pyramid

I am trying to integrate Sentry into my company’s Pyramid web application. I’ve followed the integration docs here and my events are showing up in Sentry, which is great!

My current issue is that I want to separate events by environment. To do that, what I’ve done is add the environment to the raven filter, like so:

use = egg:raven#raven
dsn = https://*****
environment = 'dev'

However, what I’ve noticed is that very few of my events have the “environment” attribute set. I’ve checked the loggers being used, and it doesn’t seem like the sentry logger is being used - rather, the default pyramid logger is being used

log = logging.getLogger(__name__)

In order to pass all my events through the filter_raven, do I need to change every logger to the logger_sentry? Or is there some configuration that I’m missing?

I also tried making my loggers explicitly use the logger_sentry

log = logging.getLogger('logger_sentry')

But that didn’t work either.

After some experimentation, it seems like uncaught exceptions pass through the filter, and the environment is correctly tagged in the issue. Caught exceptions do not have the environment tag. Wondering how to ensure caught exceptions pass through the raven filter.