Edgewall Software

Opened 7 years ago

Last modified 7 years ago

#12632 closed defect

TracError while post-processing leads noisy logging — at Version 2

Reported by: Jun Omae Owned by:
Priority: normal Milestone: 1.0.14
Component: general Version:
Severity: normal Keywords:
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description (last modified by Jun Omae)

TracError while executing process_request() is logged with WARNING level and no traceback. However, same exception while post-processing is logged with ERROR level and traceback. That's noisy….

See gmessage:trac-users:4tVRBotYrZs/NB3ZjUYjCAAJ.

  • trac/web/main.py

    diff --git a/trac/web/main.py b/trac/web/main.py
    index 34a43039c..6406f54b3 100644
    a b class RequestDispatcher(Component):  
    280280                except RequestDone:
    281281                    raise
    282282                except Exception, e:
    283                     self.log.error("Exception caught while post-processing"
    284                                    " request: %s",
    285                                    exception_to_unicode(e, traceback=True))
     283                    self.log.error(
     284                        "Exception caught while post-processing request: %s",
     285                        exception_to_unicode(
     286                            e, traceback=not isinstance(TracError, e)))
    286287                raise err[0], err[1], err[2]
    287288        except PermissionError, e:
    288289            raise HTTPForbidden(e)

Change History (2)

comment:1 by Jun Omae, 7 years ago

Or:

  • trac/web/main.py

    diff --git a/trac/web/main.py b/trac/web/main.py
    index 34a43039c..9820472f9 100644
    a b class RequestDispatcher(Component):  
    280280                except RequestDone:
    281281                    raise
    282282                except Exception, e:
    283                     self.log.error("Exception caught while post-processing"
    284                                    " request: %s",
    285                                    exception_to_unicode(e, traceback=True))
     283                    if isinstance(e, TracError):
     284                        self.log.warning("Exception caught while"
     285                                         " post-processing request: %s",
     286                                         exception_to_unicode(e))
     287                    else:
     288                        self.log.error("Exception caught while post-processing"
     289                                       " request: %s",
     290                                       exception_to_unicode(e, traceback=True))
    286291                raise err[0], err[1], err[2]
    287292        except PermissionError, e:
    288293            raise HTTPForbidden(e)
Last edited 7 years ago by Jun Omae (previous) (diff)

comment:2 by Jun Omae, 7 years ago

Description: modified (diff)
Note: See TracTickets for help on using tickets.