0001-rename-settings-REQUESTS_RESPONSE_CONTENT_MAX_LENGTH.patch
passerelle/settings.py | ||
---|---|---|
171 | 171 |
r'text/*', r'application/(json|xml)' |
172 | 172 |
) |
173 | 173 | |
174 |
# Max size of the response to log |
|
175 |
LOGGED_RESPONSES_MAX_SIZE = 4096 |
|
176 | ||
174 | 177 |
LOGGING = { |
175 | 178 |
'version': 1, |
176 | 179 |
'disable_existing_loggers': False, |
passerelle/utils/__init__.py | ||
---|---|---|
180 | 180 |
'requests_response_headers': resp_headers}) |
181 | 181 |
# log only if content type is allowed |
182 | 182 |
if content_type_match(response.headers.get('Content-Type')): |
183 |
content = response.content[:getattr(settings, 'REQUESTS_RESPONSE_CONTENT_MAX_LENGTH', 5000)]
|
|
183 |
content = response.content[:settings.LOGGED_RESPONSES_MAX_SIZE]
|
|
184 | 184 |
self.logger.debug('Response Content: %r' % content, |
185 | 185 |
extra={'requests_response_content': content}) |
186 | 186 |
return response |
187 |
- |