Closed freedomDR closed 4 years ago
class LoggingException(object): def __init__(self, get_response): print('__init__') self.get_response = get_response def __call__(self, request): print('--process_request--') response = self.get_response(request) print('--process_reponse--') print(dir(response)) return response def process_exception(self, request, exception): print(request) print("logging exception") print(exception)
MIDDLEWARE = [ 'django.middleware.security.SecurityMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.middleware.common.CommonMiddleware', 'django.middleware.csrf.CsrfViewMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', 'myadmin.loggingException.LoggingException', ]
when I upload large file(200M),return 400 status, but I cannot log error
I sloved it
when I upload large file(200M),return 400 status, but I cannot log error