Created
September 24, 2012 08:55
-
-
Save DazWorrall/3775003 to your computer and use it in GitHub Desktop.
Subclass the Flask exception handler
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ''' | |
| Original here: https://github.com/mitsuhiko/flask/blob/master/flask/app.py#L1295 | |
| ''' | |
| from flask import Flask | |
| class MyFlask(Flask): | |
| def log_exception(self, exc_info): | |
| """ | |
| Overriden to provide the full url (including scheme, hostname and query string) | |
| in the error message | |
| """ | |
| self.logger.error('Exception on %s [%s]' % ( | |
| request.url, # This is what we've changed from the original | |
| request.method | |
| ), exc_info=exc_info) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment