add logging middleware