Skip to content

Commit

Permalink
🔊 Reduce noisy debug logs
Browse files Browse the repository at this point in the history
Signed-off-by: ff137 <[email protected]>
  • Loading branch information
ff137 committed Feb 13, 2025
1 parent 2498758 commit 4f498ba
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
10 changes: 7 additions & 3 deletions acapy_agent/admin/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,11 +226,15 @@ async def upgrade_middleware(request: web.BaseRequest, handler: Coroutine):
async def debug_middleware(request: web.BaseRequest, handler: Coroutine):
"""Show request detail in debug log."""

if LOGGER.isEnabledFor(logging.DEBUG):
is_status_check = str(request.rel_url).startswith("/status/")

if LOGGER.isEnabledFor(logging.DEBUG) and not is_status_check:
LOGGER.debug(f"Incoming request: {request.method} {request.path_qs}")
LOGGER.debug(f"Match info: {request.match_info}")
body = await request.text() if request.body_exists else None
LOGGER.debug(f"Body: {body}")

if request.body_exists:
body = await request.text()
LOGGER.debug(f"Body: {body}")

return await handler(request)

Expand Down
1 change: 0 additions & 1 deletion acapy_agent/utils/classloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ def load_class(
mod_path, class_name = class_name.rsplit(".", 1)
elif default_module:
mod_path = default_module
LOGGER.debug("No module in class name, using default_module: %s", mod_path)
else:
LOGGER.warning(
"Cannot resolve class name %s with no default module", class_name
Expand Down

0 comments on commit 4f498ba

Please sign in to comment.