Skip to content

Commit ec22a51

Browse files
committed
Merge branch 'hotfix/less-logging'
2 parents 0bce2a9 + 8297c09 commit ec22a51

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

mfr/server/handlers/core.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,18 @@ def write_error(self, status_code, exc_info):
193193
</div>
194194
''')
195195

196+
# avoid dumping duplicate information to application log
197+
def log_exception(self, typ, value, tb):
198+
if isinstance(value, tornado.web.HTTPError):
199+
if value.log_message:
200+
format = "%d %s: " + value.log_message
201+
args = ([value.status_code, self._request_summary()] +
202+
list(value.args))
203+
tornado.web.gen_log.warning(format, *args)
204+
else:
205+
tornado.web.app_log.error("Uncaught exception %s\n", self._request_summary(),
206+
exc_info=(typ, value, tb))
207+
196208
def on_finish(self):
197209
if self.request.method not in self.ALLOWED_METHODS:
198210
return

0 commit comments

Comments
 (0)