Edgewall Software
Modify

Opened 13 years ago

Closed 9 years ago

Last modified 9 years ago

#10436 closed enhancement (fixed)

Improve debug logging for request handling

Reported by: anatoly techtonik <techtonik@…> Owned by: anatoly techtonik <techtonik@…>
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  
    200200                    # was found or not
    201201                    chosen_handler = self._pre_process_request(req,
    202202                                                            chosen_handler)
     203                    self.log.debug('Choosing %r as request handler' % chosen_handler)
    203204                except TracError, e:
    204205                    raise HTTPInternalError(e)
    205206                if not chosen_handler:
     
    244245                        req.session.save()
    245246                        req.display(template, content_type or 'text/html')
    246247                    else: # Genshi
     248                        self.log.debug('Rendering response from handler')
    247249                        template, data, content_type = \
    248250                                  self._post_process_request(req, *resp)
    249251                        if 'hdfdump' in req.args:
     
    260262                            req.session.save()
    261263                            req.send(output, content_type or 'text/html')
    262264                else:
     265                    self.log.debug('No response from handler, enter postprocessing')
    263266                    self._post_process_request(req)
    264267            except RequestDone:
     268                self.log.debug('Escalating RequestDone exception')
    265269                raise
    266270            except:
     271                self.log.debug('Request error postprocessing')
    267272                # post-process the request in case of errors
    268273                err = sys.exc_info()
    269274                try:

Attachments (0)

Change History (6)

comment:1 by Christian Boos, 13 years ago

Milestone: 0.13
Priority: normallow
Severity: normalminor

Why not, and maybe also some (optional) timings.

comment:2 by Remy Blank, 13 years ago

Milestone: 1.01.0-triage

Preparing for 1.0.

comment:3 by Ryan J Ollos, 9 years ago

Milestone: next-stable-1.0.x1.2
Owner: set to Ryan J Ollos
Release Notes: modified (diff)
Status: newassigned
Type: defectenhancement

comment:4 by Ryan J Ollos, 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 Ryan J Ollos, 9 years ago

Resolution: fixed
Status: assignedclosed

Committed to trunk in [14231].

comment:6 by Ryan J Ollos, 9 years ago

Owner: changed from Ryan J Ollos to anatoly techtonik <techtonik@…>

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain anatoly techtonik <techtonik@…>.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from anatoly techtonik <techtonik@…> to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.