diff --git a/radicale/app/__init__.py b/radicale/app/__init__.py index 19cf1e57..3b8d1800 100644 --- a/radicale/app/__init__.py +++ b/radicale/app/__init__.py @@ -145,6 +145,8 @@ class Application(ApplicationPartDelete, ApplicationPartHead, if isinstance(answer, str): if self._response_content_on_debug: logger.debug("Response content:\n%s", answer) + else: + logger.debug("Response content: suppressed by config/option [auth] response_content_on_debug") headers["Content-Type"] += "; charset=%s" % self._encoding answer = answer.encode(self._encoding) accept_encoding = [ @@ -191,8 +193,10 @@ class Application(ApplicationPartDelete, ApplicationPartHead, request_method, unsafe_path, depthinfo, remote_host, remote_useragent) if self._request_header_on_debug: - logger.debug("Request headers:\n%s", + logger.debug("Request header:\n%s", pprint.pformat(self._scrub_headers(environ))) + else: + logger.debug("Request header: suppressed by config/option [auth] request_header_on_debug") # SCRIPT_NAME is already removed from PATH_INFO, according to the # WSGI specification. diff --git a/radicale/app/base.py b/radicale/app/base.py index 0a3a27cf..15b5a1df 100644 --- a/radicale/app/base.py +++ b/radicale/app/base.py @@ -75,6 +75,8 @@ class ApplicationBase: if self._response_content_on_debug: logger.debug("Response content:\n%s", xmlutils.pretty_xml(xml_content)) + else: + logger.debug("Response content: suppressed by config/option [auth] response_content_on_debug") f = io.BytesIO() ET.ElementTree(xml_content).write(f, encoding=self._encoding, xml_declaration=True) diff --git a/radicale/app/put.py b/radicale/app/put.py index d013c5d5..e30c4e07 100644 --- a/radicale/app/put.py +++ b/radicale/app/put.py @@ -149,6 +149,8 @@ class ApplicationPartPut(ApplicationBase): "Bad PUT request on %r (read_components): %s", path, e, exc_info=True) if self._log_bad_put_request_content: logger.warning("Bad PUT request content of %r:\n%s", path, content) + else: + logger.debug("Bad PUT request content: suppressed by config/option [auth] bad_put_request_content") return httputils.BAD_REQUEST (prepared_items, prepared_tag, prepared_write_whole_collection, prepared_props, prepared_exc_info) = prepare( diff --git a/radicale/httputils.py b/radicale/httputils.py index 766850c2..a9565293 100644 --- a/radicale/httputils.py +++ b/radicale/httputils.py @@ -145,6 +145,8 @@ def read_request_body(configuration: "config.Configuration", read_raw_request_body(configuration, environ)) if configuration.get("logging", "request_content_on_debug"): logger.debug("Request content:\n%s", content) + else: + logger.debug("Request content: suppressed by config/option [auth] request_content_on_debug") return content