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 246332ee..a9565293 100644 --- a/radicale/httputils.py +++ b/radicale/httputils.py @@ -2,7 +2,8 @@ # Copyright © 2008 Nicolas Kandel # Copyright © 2008 Pascal Halter # Copyright © 2008-2017 Guillaume Ayoub -# Copyright © 2017-2018 Unrud +# Copyright © 2017-2022 Unrud +# Copyright © 2024-2024 Peter Bieringer # # This library is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -144,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 diff --git a/radicale/log.py b/radicale/log.py index 59473644..313b4933 100644 --- a/radicale/log.py +++ b/radicale/log.py @@ -1,6 +1,7 @@ # This file is part of Radicale - CalDAV and CardDAV server # Copyright © 2011-2017 Guillaume Ayoub -# Copyright © 2017-2019 Unrud +# Copyright © 2017-2023 Unrud +# Copyright © 2024-2024 Peter Bieringer # # This library is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by