def _log_function(self, handler):
        """Override Application.log_function so that what to log can be controlled.
        """
        if handler.get_status() < 400:
            log_method = request_log.info
        elif handler.get_status() < 500:
            log_method = request_log.warning
        else:
            log_method = request_log.error
        for i in settings['LOGGING_IGNORE_URLS']:
            if handler.request.uri.startswith(i):
                log_method = request_log.debug
                break

        request_time = 1000.0 * handler.request.request_time()
        log_method("%d %s %.2fms", handler.get_status(),
                   handler._request_summary(), request_time)