logging: change result loglevel also for some seldom methods
This commit is contained in:
@@ -354,14 +354,14 @@ class Application(ApplicationPartDelete, ApplicationPartHead,
|
|||||||
message = "%s response status for %r%s in %.3f seconds: %s" % (
|
message = "%s response status for %r%s in %.3f seconds: %s" % (
|
||||||
request_method, unsafe_path, depthinfo,
|
request_method, unsafe_path, depthinfo,
|
||||||
time_delta_seconds, status_text)
|
time_delta_seconds, status_text)
|
||||||
if status < 400:
|
logger_method = logger.info # default
|
||||||
logger.info(message)
|
if status == 401 or status == 404 or status == 412 or status == 409 or request_method in ["PROPPATCH", "MKCALENDAR", "MKCOL"]:
|
||||||
elif status == 401 or status == 404 or status == 412 or status == 409:
|
logger_method = logger.notice
|
||||||
logger.notice(message)
|
|
||||||
elif status < 500:
|
elif status < 500:
|
||||||
logger.error(message)
|
logger_method = logger.error
|
||||||
else:
|
else:
|
||||||
logger.critical(message)
|
logger_method = logger.critical
|
||||||
|
logger_method(message)
|
||||||
|
|
||||||
# Profiling end
|
# Profiling end
|
||||||
if self._profiling_per_request:
|
if self._profiling_per_request:
|
||||||
|
|||||||
Reference in New Issue
Block a user