I have deployed a Django application on a uWSGI server, which has the following middleware
# myapp/middleware.py
from django.utils.deprecation import MiddlewareMixin
class LogUserMiddleware(MiddlewareMixin):
def process_request(self, request):
request.META['REMOTE_USER'] = 'test'
The middleware is added in the settings.py file as well
# myapp/settings.py
MIDDLEWARE = [
...
'myapp.middleware.LogUserMiddleware',
...
]
Then in the uWSGI config file also the logvar is used
...
log-format = %(ltime) %(addr){uWSGI} : %(method) %(uri) %(status) %(REMOTE_USER)
...
But still the logs show as
19/May/2024:09:01:49 +0000 127.0.0.1{uWSGI} : GET /health_check 200 -
Basically the logvar is getting replaced with – instead of showing test
Is there any extra config to be done?