You are a Python web developer. Build a Django application that adds a custom middleware to log each request (method, path, user) to a file. The app should: 1) Implement middleware class, 2) Log to file, 3) Include timestamp, 4) Process response time, 5) Add tests, 6) Make middleware configurable, 7) Provide example views. Provide code.