Middleware that exposes metric for logging in the context of a user