Skip to content

Reduce logging verbosity in PDF preview endpoint #506

@cbcoutinho

Description

@cbcoutinho

Problem

Every PDF preview request logs at INFO level (lines 682, 687, 781 in visualization.py):

logger.info(f"PDF preview request: file_path={file_path_param}, page={page_param}")
logger.info(f"PDF preview authenticated for user: {user_id}")
logger.info(f"Rendered PDF preview: {file_path} page {page_num}/{total_pages}, {len(png_bytes):,} bytes")

In production with many users, this creates excessive log noise.

Recommendation

  • Change lines 682, 687 to logger.debug()
  • Keep line 781 as logger.info() but consider sampling or only logging on errors

Location

  • nextcloud_mcp_server/api/visualization.py:682, 687, 781

Priority

Recommended - Should fix for production environments

Parent Issue

Part of #502

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions