Are you sure, this route servers any request successfully at all? Possibilities to achieve your goal are: A WSGI middleware, a Pyramid Tween or a custom event subscriber.
The custom subscriber would probably be the most easy one. This subscriber is called before the response is created, so it can't know the response code, content etc. To accomplish this you can either add a request finished callback or use one of the other methods.
from pyramid.events import NewRequest
from pyramid.events import subscriber
@subscriber(NewRequest)
def static_logger(event):
logger = logging.getLogger('static')
request = event.request
if request.path_info.startswith('/static'):
logger.info('static request: {} {}'.format(request.path_info,
request.query_string))
And activate the logger in development.ini:
[loggers]
keys = root, static
[logger_static]
level = DEBUG
handlers = console
qualname = static