Added middleware logging.