Don't log exceptions that are handled by Django's HTTP layer.

Review Request #8622 — Created Jan. 16, 2017 and submitted

Information

Djblets
release-0.8.x
f070fe5...

Reviewers

Our logging middleware listens for exceptions raised during a page view
and logs them, but this isn't always ideal. There are some exceptions
(Http404, PermissionDenied, and SuspiciousOperation) that Django
itself handles and logs (though in a log handler we currently don't use).
In the case of Http404, we really don't want to see the exception, as it's
not truly an error and just clutters up the log files.

This adds a list of exceptions to ignore, and also improves the current
exception logging to log additional information about the request.

Tested actual exceptions raised on a page and verified I could see the
logging information.

Tested Http404, PermissionDenied, and SuspiciousOperation
exceptions. Verified they did not invoke our logging.

reviewbot
  1. Tool: Pyflakes
    Processed Files:
        djblets/log/middleware.py
    
    
    
    Tool: PEP8 Style Checker
    Processed Files:
        djblets/log/middleware.py
    
    
  2. 
      
david
  1. Ship It!
  2. 
      
chipx86
Review request changed
Status:
Completed
Change Summary:
Pushed to release-0.8.x (55d70b1)