Skip to content

Add Missing Logs Across Platform for Key Events and Actions #235

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

avirajsingh7
Copy link
Collaborator

@avirajsingh7 avirajsingh7 commented Jun 18, 2025

This PR introduces comprehensive logging across the platform to improve observability, traceability, and debugging efficiency.

Target issue : #213 and #234

  • Added missing logs in critical modules.
  • Logs follow a structured and consistent format for clarity:
logger.info(
    f"[<module>.<action>] <message> | key1={value1}, key2={value2}, ..."
)
  • Middleware added to automatically log all incoming HTTP requests with metadata
  • Separation of Log Levels based on info, warning, error

@avirajsingh7 avirajsingh7 marked this pull request as draft June 18, 2025 06:00
Copy link

codecov bot commented Jun 18, 2025

@avirajsingh7 avirajsingh7 marked this pull request as ready for review June 18, 2025 08:33
@avirajsingh7 avirajsingh7 added enhancement New feature or request ready-for-review labels Jun 18, 2025
@avirajsingh7 avirajsingh7 self-assigned this Jun 18, 2025

logger = logging.getLogger(__name__)
router = APIRouter(tags=["private"], prefix="/private")

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not think that we need to implement logging in this file since it is not being used, and also not needed for project_user route as well since we already have a project user relationship with the api key generation

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lets just keep it, may be if we need in future or if we remove code logging will be removed also

from sqlmodel import Session, select, delete, func
from app.models import ProjectUser, ProjectUserPublic, User, Project
from datetime import datetime, timezone

from app.core.util import now

logger = logging.getLogger(__name__)


def is_project_admin(session: Session, user_id: int, project_id: int) -> bool:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same comment as above

This was linked to issues Jun 20, 2025
@avirajsingh7 avirajsingh7 marked this pull request as draft June 24, 2025 08:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Logs Segregation Review Logs
3 participants