Added logging middleware option