Modify ↓
#10436 closed enhancement (fixed)
Improve debug logging for request handling
Reported by: | Owned by: | ||
---|---|---|---|
Priority: | low | Milestone: | 1.2 |
Component: | general | Version: | |
Severity: | minor | Keywords: | |
Cc: | Branch: | ||
Release Notes: |
Added additional debug logging for request handling. |
||
API Changes: | |||
Internal Changes: |
Description
The patch below improves debugging for Trac by logging names of request handler chosen to proces given request and result of its processing.
-
trac/web/main.py
diff -ubr trac/0.12.2/trac/web/main.py Trac-0.12.2-py2.6.egg/trac/web/main.py
old new 200 200 # was found or not 201 201 chosen_handler = self._pre_process_request(req, 202 202 chosen_handler) 203 self.log.debug('Choosing %r as request handler' % chosen_handler) 203 204 except TracError, e: 204 205 raise HTTPInternalError(e) 205 206 if not chosen_handler: … … 244 245 req.session.save() 245 246 req.display(template, content_type or 'text/html') 246 247 else: # Genshi 248 self.log.debug('Rendering response from handler') 247 249 template, data, content_type = \ 248 250 self._post_process_request(req, *resp) 249 251 if 'hdfdump' in req.args: … … 260 262 req.session.save() 261 263 req.send(output, content_type or 'text/html') 262 264 else: 265 self.log.debug('No response from handler, enter postprocessing') 263 266 self._post_process_request(req) 264 267 except RequestDone: 268 self.log.debug('Escalating RequestDone exception') 265 269 raise 266 270 except: 271 self.log.debug('Request error postprocessing') 267 272 # post-process the request in case of errors 268 273 err = sys.exc_info() 269 274 try:
Attachments (0)
Change History (6)
comment:1 by , 13 years ago
Milestone: | → 0.13 |
---|---|
Priority: | normal → low |
Severity: | normal → minor |
comment:3 by , 9 years ago
Milestone: | next-stable-1.0.x → 1.2 |
---|---|
Owner: | set to |
Release Notes: | modified (diff) |
Status: | new → assigned |
Type: | defect → enhancement |
comment:4 by , 9 years ago
Proposed changes in log:rjollos.git:t10436. It didn't seem useful to add logging before RequestDone
is raised, and in the case of Request error postprocessing the exception will be raised just after the statement is logged.
If there's justification for additional logging please let me know.
comment:5 by , 9 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
Committed to trunk in [14231].
comment:6 by , 9 years ago
Owner: | changed from | to
---|
Note:
See TracTickets
for help on using tickets.
Why not, and maybe also some (optional) timings.